container-gen.go 500 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974
  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package container provides access to the Kubernetes Engine API.
  6. //
  7. // For product documentation, see: https://cloud.google.com/container-engine/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/container/v1"
  14. // ...
  15. // ctx := context.Background()
  16. // containerService, err := container.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // containerService, err := container.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // containerService, err := container.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package container // import "google.golang.org/api/container/v1"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "container:v1"
  67. const apiName = "container"
  68. const apiVersion = "v1"
  69. const basePath = "https://container.googleapis.com/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // View and manage your data across Google Cloud Platform services
  73. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  74. )
  75. // NewService creates a new Service.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/cloud-platform",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new Service. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*Service, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &Service{client: client, BasePath: basePath}
  105. s.Projects = NewProjectsService(s)
  106. return s, nil
  107. }
  108. type Service struct {
  109. client *http.Client
  110. BasePath string // API endpoint base URL
  111. UserAgent string // optional additional User-Agent fragment
  112. Projects *ProjectsService
  113. }
  114. func (s *Service) userAgent() string {
  115. if s.UserAgent == "" {
  116. return googleapi.UserAgent
  117. }
  118. return googleapi.UserAgent + " " + s.UserAgent
  119. }
  120. func NewProjectsService(s *Service) *ProjectsService {
  121. rs := &ProjectsService{s: s}
  122. rs.Aggregated = NewProjectsAggregatedService(s)
  123. rs.Locations = NewProjectsLocationsService(s)
  124. rs.Zones = NewProjectsZonesService(s)
  125. return rs
  126. }
  127. type ProjectsService struct {
  128. s *Service
  129. Aggregated *ProjectsAggregatedService
  130. Locations *ProjectsLocationsService
  131. Zones *ProjectsZonesService
  132. }
  133. func NewProjectsAggregatedService(s *Service) *ProjectsAggregatedService {
  134. rs := &ProjectsAggregatedService{s: s}
  135. rs.UsableSubnetworks = NewProjectsAggregatedUsableSubnetworksService(s)
  136. return rs
  137. }
  138. type ProjectsAggregatedService struct {
  139. s *Service
  140. UsableSubnetworks *ProjectsAggregatedUsableSubnetworksService
  141. }
  142. func NewProjectsAggregatedUsableSubnetworksService(s *Service) *ProjectsAggregatedUsableSubnetworksService {
  143. rs := &ProjectsAggregatedUsableSubnetworksService{s: s}
  144. return rs
  145. }
  146. type ProjectsAggregatedUsableSubnetworksService struct {
  147. s *Service
  148. }
  149. func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
  150. rs := &ProjectsLocationsService{s: s}
  151. rs.Clusters = NewProjectsLocationsClustersService(s)
  152. rs.Operations = NewProjectsLocationsOperationsService(s)
  153. return rs
  154. }
  155. type ProjectsLocationsService struct {
  156. s *Service
  157. Clusters *ProjectsLocationsClustersService
  158. Operations *ProjectsLocationsOperationsService
  159. }
  160. func NewProjectsLocationsClustersService(s *Service) *ProjectsLocationsClustersService {
  161. rs := &ProjectsLocationsClustersService{s: s}
  162. rs.NodePools = NewProjectsLocationsClustersNodePoolsService(s)
  163. rs.WellKnown = NewProjectsLocationsClustersWellKnownService(s)
  164. return rs
  165. }
  166. type ProjectsLocationsClustersService struct {
  167. s *Service
  168. NodePools *ProjectsLocationsClustersNodePoolsService
  169. WellKnown *ProjectsLocationsClustersWellKnownService
  170. }
  171. func NewProjectsLocationsClustersNodePoolsService(s *Service) *ProjectsLocationsClustersNodePoolsService {
  172. rs := &ProjectsLocationsClustersNodePoolsService{s: s}
  173. return rs
  174. }
  175. type ProjectsLocationsClustersNodePoolsService struct {
  176. s *Service
  177. }
  178. func NewProjectsLocationsClustersWellKnownService(s *Service) *ProjectsLocationsClustersWellKnownService {
  179. rs := &ProjectsLocationsClustersWellKnownService{s: s}
  180. return rs
  181. }
  182. type ProjectsLocationsClustersWellKnownService struct {
  183. s *Service
  184. }
  185. func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
  186. rs := &ProjectsLocationsOperationsService{s: s}
  187. return rs
  188. }
  189. type ProjectsLocationsOperationsService struct {
  190. s *Service
  191. }
  192. func NewProjectsZonesService(s *Service) *ProjectsZonesService {
  193. rs := &ProjectsZonesService{s: s}
  194. rs.Clusters = NewProjectsZonesClustersService(s)
  195. rs.Operations = NewProjectsZonesOperationsService(s)
  196. return rs
  197. }
  198. type ProjectsZonesService struct {
  199. s *Service
  200. Clusters *ProjectsZonesClustersService
  201. Operations *ProjectsZonesOperationsService
  202. }
  203. func NewProjectsZonesClustersService(s *Service) *ProjectsZonesClustersService {
  204. rs := &ProjectsZonesClustersService{s: s}
  205. rs.NodePools = NewProjectsZonesClustersNodePoolsService(s)
  206. return rs
  207. }
  208. type ProjectsZonesClustersService struct {
  209. s *Service
  210. NodePools *ProjectsZonesClustersNodePoolsService
  211. }
  212. func NewProjectsZonesClustersNodePoolsService(s *Service) *ProjectsZonesClustersNodePoolsService {
  213. rs := &ProjectsZonesClustersNodePoolsService{s: s}
  214. return rs
  215. }
  216. type ProjectsZonesClustersNodePoolsService struct {
  217. s *Service
  218. }
  219. func NewProjectsZonesOperationsService(s *Service) *ProjectsZonesOperationsService {
  220. rs := &ProjectsZonesOperationsService{s: s}
  221. return rs
  222. }
  223. type ProjectsZonesOperationsService struct {
  224. s *Service
  225. }
  226. // AcceleratorConfig: AcceleratorConfig represents a Hardware
  227. // Accelerator request.
  228. type AcceleratorConfig struct {
  229. // AcceleratorCount: The number of the accelerator cards exposed to an
  230. // instance.
  231. AcceleratorCount int64 `json:"acceleratorCount,omitempty,string"`
  232. // AcceleratorType: The accelerator type resource name. List of
  233. // supported accelerators
  234. // [here](/compute/docs/gpus/#Introduction)
  235. AcceleratorType string `json:"acceleratorType,omitempty"`
  236. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  237. // unconditionally include in API requests. By default, fields with
  238. // empty values are omitted from API requests. However, any non-pointer,
  239. // non-interface field appearing in ForceSendFields will be sent to the
  240. // server regardless of whether the field is empty or not. This may be
  241. // used to include empty fields in Patch requests.
  242. ForceSendFields []string `json:"-"`
  243. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  244. // include in API requests with the JSON null value. By default, fields
  245. // with empty values are omitted from API requests. However, any field
  246. // with an empty value appearing in NullFields will be sent to the
  247. // server as null. It is an error if a field in this list has a
  248. // non-empty value. This may be used to include null fields in Patch
  249. // requests.
  250. NullFields []string `json:"-"`
  251. }
  252. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  253. type NoMethod AcceleratorConfig
  254. raw := NoMethod(*s)
  255. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  256. }
  257. // AddonsConfig: Configuration for the addons that can be automatically
  258. // spun up in the
  259. // cluster, enabling additional functionality.
  260. type AddonsConfig struct {
  261. // HorizontalPodAutoscaling: Configuration for the horizontal pod
  262. // autoscaling feature, which
  263. // increases or decreases the number of replica pods a replication
  264. // controller
  265. // has based on the resource usage of the existing pods.
  266. HorizontalPodAutoscaling *HorizontalPodAutoscaling `json:"horizontalPodAutoscaling,omitempty"`
  267. // HttpLoadBalancing: Configuration for the HTTP (L7) load balancing
  268. // controller addon, which
  269. // makes it easy to set up HTTP load balancers for services in a
  270. // cluster.
  271. HttpLoadBalancing *HttpLoadBalancing `json:"httpLoadBalancing,omitempty"`
  272. // KubernetesDashboard: Configuration for the Kubernetes Dashboard.
  273. KubernetesDashboard *KubernetesDashboard `json:"kubernetesDashboard,omitempty"`
  274. // NetworkPolicyConfig: Configuration for NetworkPolicy. This only
  275. // tracks whether the addon
  276. // is enabled or not on the Master, it does not track whether network
  277. // policy
  278. // is enabled for the nodes.
  279. NetworkPolicyConfig *NetworkPolicyConfig `json:"networkPolicyConfig,omitempty"`
  280. // ForceSendFields is a list of field names (e.g.
  281. // "HorizontalPodAutoscaling") to unconditionally include in API
  282. // requests. By default, fields with empty values are omitted from API
  283. // requests. However, any non-pointer, non-interface field appearing in
  284. // ForceSendFields will be sent to the server regardless of whether the
  285. // field is empty or not. This may be used to include empty fields in
  286. // Patch requests.
  287. ForceSendFields []string `json:"-"`
  288. // NullFields is a list of field names (e.g. "HorizontalPodAutoscaling")
  289. // to include in API requests with the JSON null value. By default,
  290. // fields with empty values are omitted from API requests. However, any
  291. // field with an empty value appearing in NullFields will be sent to the
  292. // server as null. It is an error if a field in this list has a
  293. // non-empty value. This may be used to include null fields in Patch
  294. // requests.
  295. NullFields []string `json:"-"`
  296. }
  297. func (s *AddonsConfig) MarshalJSON() ([]byte, error) {
  298. type NoMethod AddonsConfig
  299. raw := NoMethod(*s)
  300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  301. }
  302. // AutoUpgradeOptions: AutoUpgradeOptions defines the set of options for
  303. // the user to control how
  304. // the Auto Upgrades will proceed.
  305. type AutoUpgradeOptions struct {
  306. // AutoUpgradeStartTime: [Output only] This field is set when upgrades
  307. // are about to commence
  308. // with the approximate start time for the upgrades,
  309. // in
  310. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  311. AutoUpgradeStartTime string `json:"autoUpgradeStartTime,omitempty"`
  312. // Description: [Output only] This field is set when upgrades are about
  313. // to commence
  314. // with the description of the upgrade.
  315. Description string `json:"description,omitempty"`
  316. // ForceSendFields is a list of field names (e.g.
  317. // "AutoUpgradeStartTime") to unconditionally include in API requests.
  318. // By default, fields with empty values are omitted from API requests.
  319. // However, any non-pointer, non-interface field appearing in
  320. // ForceSendFields will be sent to the server regardless of whether the
  321. // field is empty or not. This may be used to include empty fields in
  322. // Patch requests.
  323. ForceSendFields []string `json:"-"`
  324. // NullFields is a list of field names (e.g. "AutoUpgradeStartTime") to
  325. // include in API requests with the JSON null value. By default, fields
  326. // with empty values are omitted from API requests. However, any field
  327. // with an empty value appearing in NullFields will be sent to the
  328. // server as null. It is an error if a field in this list has a
  329. // non-empty value. This may be used to include null fields in Patch
  330. // requests.
  331. NullFields []string `json:"-"`
  332. }
  333. func (s *AutoUpgradeOptions) MarshalJSON() ([]byte, error) {
  334. type NoMethod AutoUpgradeOptions
  335. raw := NoMethod(*s)
  336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  337. }
  338. // CancelOperationRequest: CancelOperationRequest cancels a single
  339. // operation.
  340. type CancelOperationRequest struct {
  341. // Name: The name (project, location, operation id) of the operation to
  342. // cancel.
  343. // Specified in the format 'projects/*/locations/*/operations/*'.
  344. Name string `json:"name,omitempty"`
  345. // OperationId: Deprecated. The server-assigned `name` of the
  346. // operation.
  347. // This field has been deprecated and replaced by the name field.
  348. OperationId string `json:"operationId,omitempty"`
  349. // ProjectId: Deprecated. The Google Developers Console [project ID or
  350. // project
  351. // number](https://support.google.com/cloud/answer/6158840).
  352. // This
  353. // field has been deprecated and replaced by the name field.
  354. ProjectId string `json:"projectId,omitempty"`
  355. // Zone: Deprecated. The name of the Google Compute
  356. // Engine
  357. // [zone](/compute/docs/zones#available) in which the operation
  358. // resides.
  359. // This field has been deprecated and replaced by the name field.
  360. Zone string `json:"zone,omitempty"`
  361. // ForceSendFields is a list of field names (e.g. "Name") to
  362. // unconditionally include in API requests. By default, fields with
  363. // empty values are omitted from API requests. However, any non-pointer,
  364. // non-interface field appearing in ForceSendFields will be sent to the
  365. // server regardless of whether the field is empty or not. This may be
  366. // used to include empty fields in Patch requests.
  367. ForceSendFields []string `json:"-"`
  368. // NullFields is a list of field names (e.g. "Name") to include in API
  369. // requests with the JSON null value. By default, fields with empty
  370. // values are omitted from API requests. However, any field with an
  371. // empty value appearing in NullFields will be sent to the server as
  372. // null. It is an error if a field in this list has a non-empty value.
  373. // This may be used to include null fields in Patch requests.
  374. NullFields []string `json:"-"`
  375. }
  376. func (s *CancelOperationRequest) MarshalJSON() ([]byte, error) {
  377. type NoMethod CancelOperationRequest
  378. raw := NoMethod(*s)
  379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  380. }
  381. // CidrBlock: CidrBlock contains an optional name and one CIDR block.
  382. type CidrBlock struct {
  383. // CidrBlock: cidr_block must be specified in CIDR notation.
  384. CidrBlock string `json:"cidrBlock,omitempty"`
  385. // DisplayName: display_name is an optional field for users to identify
  386. // CIDR blocks.
  387. DisplayName string `json:"displayName,omitempty"`
  388. // ForceSendFields is a list of field names (e.g. "CidrBlock") to
  389. // unconditionally include in API requests. By default, fields with
  390. // empty values are omitted from API requests. However, any non-pointer,
  391. // non-interface field appearing in ForceSendFields will be sent to the
  392. // server regardless of whether the field is empty or not. This may be
  393. // used to include empty fields in Patch requests.
  394. ForceSendFields []string `json:"-"`
  395. // NullFields is a list of field names (e.g. "CidrBlock") to include in
  396. // API requests with the JSON null value. By default, fields with empty
  397. // values are omitted from API requests. However, any field with an
  398. // empty value appearing in NullFields will be sent to the server as
  399. // null. It is an error if a field in this list has a non-empty value.
  400. // This may be used to include null fields in Patch requests.
  401. NullFields []string `json:"-"`
  402. }
  403. func (s *CidrBlock) MarshalJSON() ([]byte, error) {
  404. type NoMethod CidrBlock
  405. raw := NoMethod(*s)
  406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  407. }
  408. // ClientCertificateConfig: Configuration for client certificates on the
  409. // cluster.
  410. type ClientCertificateConfig struct {
  411. // IssueClientCertificate: Issue a client certificate.
  412. IssueClientCertificate bool `json:"issueClientCertificate,omitempty"`
  413. // ForceSendFields is a list of field names (e.g.
  414. // "IssueClientCertificate") to unconditionally include in API requests.
  415. // By default, fields with empty values are omitted from API requests.
  416. // However, any non-pointer, non-interface field appearing in
  417. // ForceSendFields will be sent to the server regardless of whether the
  418. // field is empty or not. This may be used to include empty fields in
  419. // Patch requests.
  420. ForceSendFields []string `json:"-"`
  421. // NullFields is a list of field names (e.g. "IssueClientCertificate")
  422. // to include in API requests with the JSON null value. By default,
  423. // fields with empty values are omitted from API requests. However, any
  424. // field with an empty value appearing in NullFields will be sent to the
  425. // server as null. It is an error if a field in this list has a
  426. // non-empty value. This may be used to include null fields in Patch
  427. // requests.
  428. NullFields []string `json:"-"`
  429. }
  430. func (s *ClientCertificateConfig) MarshalJSON() ([]byte, error) {
  431. type NoMethod ClientCertificateConfig
  432. raw := NoMethod(*s)
  433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  434. }
  435. // Cluster: A Google Kubernetes Engine cluster.
  436. type Cluster struct {
  437. // AddonsConfig: Configurations for the various addons available to run
  438. // in the cluster.
  439. AddonsConfig *AddonsConfig `json:"addonsConfig,omitempty"`
  440. // ClusterIpv4Cidr: The IP address range of the container pods in this
  441. // cluster,
  442. // in
  443. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  444. //
  445. // notation (e.g. `10.96.0.0/14`). Leave blank to have
  446. // one automatically chosen or specify a `/14` block in `10.0.0.0/8`.
  447. ClusterIpv4Cidr string `json:"clusterIpv4Cidr,omitempty"`
  448. // Conditions: Which conditions caused the current cluster state.
  449. Conditions []*StatusCondition `json:"conditions,omitempty"`
  450. // CreateTime: [Output only] The time the cluster was created,
  451. // in
  452. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  453. CreateTime string `json:"createTime,omitempty"`
  454. // CurrentMasterVersion: [Output only] The current software version of
  455. // the master endpoint.
  456. CurrentMasterVersion string `json:"currentMasterVersion,omitempty"`
  457. // CurrentNodeCount: [Output only] The number of nodes currently in the
  458. // cluster. Deprecated.
  459. // Call Kubernetes API directly to retrieve node information.
  460. CurrentNodeCount int64 `json:"currentNodeCount,omitempty"`
  461. // CurrentNodeVersion: [Output only] Deprecated,
  462. // use
  463. // [NodePools.version](/kubernetes-engine/docs/reference/rest/v1/proj
  464. // ects.zones.clusters.nodePools)
  465. // instead. The current version of the node software components. If they
  466. // are
  467. // currently at multiple versions because they're in the process of
  468. // being
  469. // upgraded, this reflects the minimum version of all nodes.
  470. CurrentNodeVersion string `json:"currentNodeVersion,omitempty"`
  471. // DefaultMaxPodsConstraint: The default constraint on the maximum
  472. // number of pods that can be run
  473. // simultaneously on a node in the node pool of this cluster. Only
  474. // honored
  475. // if cluster created with IP Alias support.
  476. DefaultMaxPodsConstraint *MaxPodsConstraint `json:"defaultMaxPodsConstraint,omitempty"`
  477. // Description: An optional description of this cluster.
  478. Description string `json:"description,omitempty"`
  479. // EnableKubernetesAlpha: Kubernetes alpha features are enabled on this
  480. // cluster. This includes alpha
  481. // API groups (e.g. v1alpha1) and features that may not be production
  482. // ready in
  483. // the kubernetes version of the master and nodes.
  484. // The cluster has no SLA for uptime and master/node upgrades are
  485. // disabled.
  486. // Alpha enabled clusters are automatically deleted thirty days
  487. // after
  488. // creation.
  489. EnableKubernetesAlpha bool `json:"enableKubernetesAlpha,omitempty"`
  490. // EnableTpu: Enable the ability to use Cloud TPUs in this cluster.
  491. EnableTpu bool `json:"enableTpu,omitempty"`
  492. // Endpoint: [Output only] The IP address of this cluster's master
  493. // endpoint.
  494. // The endpoint can be accessed from the internet
  495. // at
  496. // `https://username:password@endpoint/`.
  497. //
  498. // See the `masterAuth` property of this resource for username
  499. // and
  500. // password information.
  501. Endpoint string `json:"endpoint,omitempty"`
  502. // ExpireTime: [Output only] The time the cluster will be
  503. // automatically
  504. // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text
  505. // format.
  506. ExpireTime string `json:"expireTime,omitempty"`
  507. // InitialClusterVersion: The initial Kubernetes version for this
  508. // cluster. Valid versions are those
  509. // found in validMasterVersions returned by getServerConfig. The
  510. // version can
  511. // be upgraded over time; such upgrades are reflected
  512. // in
  513. // currentMasterVersion and currentNodeVersion.
  514. //
  515. // Users may specify either explicit versions offered by
  516. // Kubernetes Engine or version aliases, which have the following
  517. // behavior:
  518. //
  519. // - "latest": picks the highest valid Kubernetes version
  520. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  521. // version
  522. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  523. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  524. // - "","-": picks the default Kubernetes version
  525. InitialClusterVersion string `json:"initialClusterVersion,omitempty"`
  526. // InitialNodeCount: The number of nodes to create in this cluster. You
  527. // must ensure that your
  528. // Compute Engine <a href="/compute/docs/resource-quotas">resource
  529. // quota</a>
  530. // is sufficient for this number of instances. You must also have
  531. // available
  532. // firewall and routes quota.
  533. // For requests, this field should only be used in lieu of a
  534. // "node_pool" object, since this configuration (along with
  535. // the
  536. // "node_config") will be used to create a "NodePool" object with
  537. // an
  538. // auto-generated name. Do not use this and a node_pool at the same
  539. // time.
  540. //
  541. // This field is deprecated, use node_pool.initial_node_count instead.
  542. InitialNodeCount int64 `json:"initialNodeCount,omitempty"`
  543. // InstanceGroupUrls: Deprecated. Use node_pools.instance_group_urls.
  544. InstanceGroupUrls []string `json:"instanceGroupUrls,omitempty"`
  545. // IpAllocationPolicy: Configuration for cluster IP allocation.
  546. IpAllocationPolicy *IPAllocationPolicy `json:"ipAllocationPolicy,omitempty"`
  547. // LabelFingerprint: The fingerprint of the set of labels for this
  548. // cluster.
  549. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  550. // LegacyAbac: Configuration for the legacy ABAC authorization mode.
  551. LegacyAbac *LegacyAbac `json:"legacyAbac,omitempty"`
  552. // Location: [Output only] The name of the Google Compute
  553. // Engine
  554. // [zone](/compute/docs/regions-zones/regions-zones#available)
  555. // or
  556. // [region](/compute/docs/regions-zones/regions-zones#available) in
  557. // which
  558. // the cluster resides.
  559. Location string `json:"location,omitempty"`
  560. // Locations: The list of Google Compute
  561. // Engine
  562. // [zones](/compute/docs/zones#available) in which the cluster's
  563. // nodes
  564. // should be located.
  565. Locations []string `json:"locations,omitempty"`
  566. // LoggingService: The logging service the cluster should use to write
  567. // logs.
  568. // Currently available options:
  569. //
  570. // * `logging.googleapis.com` - the Google Cloud Logging service.
  571. // * `none` - no logs will be exported from the cluster.
  572. // * if left as an empty string,`logging.googleapis.com` will be used.
  573. LoggingService string `json:"loggingService,omitempty"`
  574. // MaintenancePolicy: Configure the maintenance policy for this cluster.
  575. MaintenancePolicy *MaintenancePolicy `json:"maintenancePolicy,omitempty"`
  576. // MasterAuth: The authentication information for accessing the master
  577. // endpoint.
  578. // If unspecified, the defaults are used:
  579. // For clusters before v1.12, if master_auth is unspecified, `username`
  580. // will
  581. // be set to "admin", a random password will be generated, and a
  582. // client
  583. // certificate will be issued.
  584. MasterAuth *MasterAuth `json:"masterAuth,omitempty"`
  585. // MasterAuthorizedNetworksConfig: The configuration options for master
  586. // authorized networks feature.
  587. MasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `json:"masterAuthorizedNetworksConfig,omitempty"`
  588. // MonitoringService: The monitoring service the cluster should use to
  589. // write metrics.
  590. // Currently available options:
  591. //
  592. // * `monitoring.googleapis.com` - the Google Cloud Monitoring
  593. // service.
  594. // * `none` - no metrics will be exported from the cluster.
  595. // * if left as an empty string, `monitoring.googleapis.com` will be
  596. // used.
  597. MonitoringService string `json:"monitoringService,omitempty"`
  598. // Name: The name of this cluster. The name must be unique within this
  599. // project
  600. // and zone, and can be up to 40 characters with the following
  601. // restrictions:
  602. //
  603. // * Lowercase letters, numbers, and hyphens only.
  604. // * Must start with a letter.
  605. // * Must end with a number or a letter.
  606. Name string `json:"name,omitempty"`
  607. // Network: The name of the Google Compute
  608. // Engine
  609. // [network](/compute/docs/networks-and-firewalls#networks) to which
  610. // the
  611. // cluster is connected. If left unspecified, the `default` network
  612. // will be used.
  613. Network string `json:"network,omitempty"`
  614. // NetworkConfig: Configuration for cluster networking.
  615. NetworkConfig *NetworkConfig `json:"networkConfig,omitempty"`
  616. // NetworkPolicy: Configuration options for the NetworkPolicy feature.
  617. NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"`
  618. // NodeConfig: Parameters used in creating the cluster's nodes.
  619. // For requests, this field should only be used in lieu of a
  620. // "node_pool" object, since this configuration (along with
  621. // the
  622. // "initial_node_count") will be used to create a "NodePool" object with
  623. // an
  624. // auto-generated name. Do not use this and a node_pool at the same
  625. // time.
  626. // For responses, this field will be populated with the node
  627. // configuration of
  628. // the first node pool. (For configuration of each node pool,
  629. // see
  630. // `node_pool.config`)
  631. //
  632. // If unspecified, the defaults are used.
  633. // This field is deprecated, use node_pool.config instead.
  634. NodeConfig *NodeConfig `json:"nodeConfig,omitempty"`
  635. // NodeIpv4CidrSize: [Output only] The size of the address space on each
  636. // node for hosting
  637. // containers. This is provisioned from within the
  638. // `container_ipv4_cidr`
  639. // range. This field will only be set when cluster is in route-based
  640. // network
  641. // mode.
  642. NodeIpv4CidrSize int64 `json:"nodeIpv4CidrSize,omitempty"`
  643. // NodePools: The node pools associated with this cluster.
  644. // This field should not be set if "node_config" or "initial_node_count"
  645. // are
  646. // specified.
  647. NodePools []*NodePool `json:"nodePools,omitempty"`
  648. // PrivateClusterConfig: Configuration for private cluster.
  649. PrivateClusterConfig *PrivateClusterConfig `json:"privateClusterConfig,omitempty"`
  650. // ResourceLabels: The resource labels for the cluster to use to
  651. // annotate any related
  652. // Google Compute Engine resources.
  653. ResourceLabels map[string]string `json:"resourceLabels,omitempty"`
  654. // SelfLink: [Output only] Server-defined URL for the resource.
  655. SelfLink string `json:"selfLink,omitempty"`
  656. // ServicesIpv4Cidr: [Output only] The IP address range of the
  657. // Kubernetes services in
  658. // this cluster,
  659. // in
  660. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  661. //
  662. // notation (e.g. `1.2.3.4/29`). Service addresses are
  663. // typically put in the last `/16` from the container CIDR.
  664. ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"`
  665. // Status: [Output only] The current status of this cluster.
  666. //
  667. // Possible values:
  668. // "STATUS_UNSPECIFIED" - Not set.
  669. // "PROVISIONING" - The PROVISIONING state indicates the cluster is
  670. // being created.
  671. // "RUNNING" - The RUNNING state indicates the cluster has been
  672. // created and is fully
  673. // usable.
  674. // "RECONCILING" - The RECONCILING state indicates that some work is
  675. // actively being done on
  676. // the cluster, such as upgrading the master or node software. Details
  677. // can
  678. // be found in the `statusMessage` field.
  679. // "STOPPING" - The STOPPING state indicates the cluster is being
  680. // deleted.
  681. // "ERROR" - The ERROR state indicates the cluster may be unusable.
  682. // Details
  683. // can be found in the `statusMessage` field.
  684. // "DEGRADED" - The DEGRADED state indicates the cluster requires user
  685. // action to restore
  686. // full functionality. Details can be found in the `statusMessage`
  687. // field.
  688. Status string `json:"status,omitempty"`
  689. // StatusMessage: [Output only] Additional information about the current
  690. // status of this
  691. // cluster, if available.
  692. StatusMessage string `json:"statusMessage,omitempty"`
  693. // Subnetwork: The name of the Google Compute
  694. // Engine
  695. // [subnetwork](/compute/docs/subnetworks) to which the
  696. // cluster is connected.
  697. Subnetwork string `json:"subnetwork,omitempty"`
  698. // TpuIpv4CidrBlock: [Output only] The IP address range of the Cloud
  699. // TPUs in this cluster,
  700. // in
  701. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  702. //
  703. // notation (e.g. `1.2.3.4/29`).
  704. TpuIpv4CidrBlock string `json:"tpuIpv4CidrBlock,omitempty"`
  705. // Zone: [Output only] The name of the Google Compute
  706. // Engine
  707. // [zone](/compute/docs/zones#available) in which the
  708. // cluster
  709. // resides.
  710. // This field is deprecated, use location instead.
  711. Zone string `json:"zone,omitempty"`
  712. // ServerResponse contains the HTTP response code and headers from the
  713. // server.
  714. googleapi.ServerResponse `json:"-"`
  715. // ForceSendFields is a list of field names (e.g. "AddonsConfig") to
  716. // unconditionally include in API requests. By default, fields with
  717. // empty values are omitted from API requests. However, any non-pointer,
  718. // non-interface field appearing in ForceSendFields will be sent to the
  719. // server regardless of whether the field is empty or not. This may be
  720. // used to include empty fields in Patch requests.
  721. ForceSendFields []string `json:"-"`
  722. // NullFields is a list of field names (e.g. "AddonsConfig") to include
  723. // in API requests with the JSON null value. By default, fields with
  724. // empty values are omitted from API requests. However, any field with
  725. // an empty value appearing in NullFields will be sent to the server as
  726. // null. It is an error if a field in this list has a non-empty value.
  727. // This may be used to include null fields in Patch requests.
  728. NullFields []string `json:"-"`
  729. }
  730. func (s *Cluster) MarshalJSON() ([]byte, error) {
  731. type NoMethod Cluster
  732. raw := NoMethod(*s)
  733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  734. }
  735. // ClusterUpdate: ClusterUpdate describes an update to the cluster.
  736. // Exactly one update can
  737. // be applied to a cluster with each request, so at most one field can
  738. // be
  739. // provided.
  740. type ClusterUpdate struct {
  741. // DesiredAddonsConfig: Configurations for the various addons available
  742. // to run in the cluster.
  743. DesiredAddonsConfig *AddonsConfig `json:"desiredAddonsConfig,omitempty"`
  744. // DesiredImageType: The desired image type for the node pool.
  745. // NOTE: Set the "desired_node_pool" field as well.
  746. DesiredImageType string `json:"desiredImageType,omitempty"`
  747. // DesiredLocations: The desired list of Google Compute
  748. // Engine
  749. // [zones](/compute/docs/zones#available) in which the cluster's
  750. // nodes
  751. // should be located. Changing the locations a cluster is in will
  752. // result
  753. // in nodes being either created or removed from the cluster, depending
  754. // on
  755. // whether locations are being added or removed.
  756. //
  757. // This list must always include the cluster's primary zone.
  758. DesiredLocations []string `json:"desiredLocations,omitempty"`
  759. // DesiredMasterAuthorizedNetworksConfig: The desired configuration
  760. // options for master authorized networks feature.
  761. DesiredMasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `json:"desiredMasterAuthorizedNetworksConfig,omitempty"`
  762. // DesiredMasterVersion: The Kubernetes version to change the master
  763. // to.
  764. //
  765. // Users may specify either explicit versions offered by
  766. // Kubernetes Engine or version aliases, which have the following
  767. // behavior:
  768. //
  769. // - "latest": picks the highest valid Kubernetes version
  770. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  771. // version
  772. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  773. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  774. // - "-": picks the default Kubernetes version
  775. DesiredMasterVersion string `json:"desiredMasterVersion,omitempty"`
  776. // DesiredMonitoringService: The monitoring service the cluster should
  777. // use to write metrics.
  778. // Currently available options:
  779. //
  780. // * "monitoring.googleapis.com" - the Google Cloud Monitoring service
  781. // * "none" - no metrics will be exported from the cluster
  782. DesiredMonitoringService string `json:"desiredMonitoringService,omitempty"`
  783. // DesiredNodePoolAutoscaling: Autoscaler configuration for the node
  784. // pool specified in
  785. // desired_node_pool_id. If there is only one pool in the
  786. // cluster and desired_node_pool_id is not provided then
  787. // the change applies to that single node pool.
  788. DesiredNodePoolAutoscaling *NodePoolAutoscaling `json:"desiredNodePoolAutoscaling,omitempty"`
  789. // DesiredNodePoolId: The node pool to be upgraded. This field is
  790. // mandatory if
  791. // "desired_node_version", "desired_image_family"
  792. // or
  793. // "desired_node_pool_autoscaling" is specified and there is more than
  794. // one
  795. // node pool on the cluster.
  796. DesiredNodePoolId string `json:"desiredNodePoolId,omitempty"`
  797. // DesiredNodeVersion: The Kubernetes version to change the nodes to
  798. // (typically an
  799. // upgrade).
  800. //
  801. // Users may specify either explicit versions offered by
  802. // Kubernetes Engine or version aliases, which have the following
  803. // behavior:
  804. //
  805. // - "latest": picks the highest valid Kubernetes version
  806. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  807. // version
  808. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  809. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  810. // - "-": picks the Kubernetes master version
  811. DesiredNodeVersion string `json:"desiredNodeVersion,omitempty"`
  812. // ForceSendFields is a list of field names (e.g. "DesiredAddonsConfig")
  813. // to unconditionally include in API requests. By default, fields with
  814. // empty values are omitted from API requests. However, any non-pointer,
  815. // non-interface field appearing in ForceSendFields will be sent to the
  816. // server regardless of whether the field is empty or not. This may be
  817. // used to include empty fields in Patch requests.
  818. ForceSendFields []string `json:"-"`
  819. // NullFields is a list of field names (e.g. "DesiredAddonsConfig") to
  820. // include in API requests with the JSON null value. By default, fields
  821. // with empty values are omitted from API requests. However, any field
  822. // with an empty value appearing in NullFields will be sent to the
  823. // server as null. It is an error if a field in this list has a
  824. // non-empty value. This may be used to include null fields in Patch
  825. // requests.
  826. NullFields []string `json:"-"`
  827. }
  828. func (s *ClusterUpdate) MarshalJSON() ([]byte, error) {
  829. type NoMethod ClusterUpdate
  830. raw := NoMethod(*s)
  831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  832. }
  833. // CompleteIPRotationRequest: CompleteIPRotationRequest moves the
  834. // cluster master back into single-IP mode.
  835. type CompleteIPRotationRequest struct {
  836. // ClusterId: Deprecated. The name of the cluster.
  837. // This field has been deprecated and replaced by the name field.
  838. ClusterId string `json:"clusterId,omitempty"`
  839. // Name: The name (project, location, cluster id) of the cluster to
  840. // complete IP
  841. // rotation. Specified in the format
  842. // 'projects/*/locations/*/clusters/*'.
  843. Name string `json:"name,omitempty"`
  844. // ProjectId: Deprecated. The Google Developers Console [project ID or
  845. // project
  846. // number](https://developers.google.com/console/help/new/#projec
  847. // tnumber).
  848. // This field has been deprecated and replaced by the name field.
  849. ProjectId string `json:"projectId,omitempty"`
  850. // Zone: Deprecated. The name of the Google Compute
  851. // Engine
  852. // [zone](/compute/docs/zones#available) in which the
  853. // cluster
  854. // resides.
  855. // This field has been deprecated and replaced by the name field.
  856. Zone string `json:"zone,omitempty"`
  857. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  858. // unconditionally include in API requests. By default, fields with
  859. // empty values are omitted from API requests. However, any non-pointer,
  860. // non-interface field appearing in ForceSendFields will be sent to the
  861. // server regardless of whether the field is empty or not. This may be
  862. // used to include empty fields in Patch requests.
  863. ForceSendFields []string `json:"-"`
  864. // NullFields is a list of field names (e.g. "ClusterId") to include in
  865. // API requests with the JSON null value. By default, fields with empty
  866. // values are omitted from API requests. However, any field with an
  867. // empty value appearing in NullFields will be sent to the server as
  868. // null. It is an error if a field in this list has a non-empty value.
  869. // This may be used to include null fields in Patch requests.
  870. NullFields []string `json:"-"`
  871. }
  872. func (s *CompleteIPRotationRequest) MarshalJSON() ([]byte, error) {
  873. type NoMethod CompleteIPRotationRequest
  874. raw := NoMethod(*s)
  875. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  876. }
  877. // CreateClusterRequest: CreateClusterRequest creates a cluster.
  878. type CreateClusterRequest struct {
  879. // Cluster: A
  880. // [cluster
  881. // resource](/container-engine/reference/rest/v1/projects.zones.
  882. // clusters)
  883. Cluster *Cluster `json:"cluster,omitempty"`
  884. // Parent: The parent (project and location) where the cluster will be
  885. // created.
  886. // Specified in the format 'projects/*/locations/*'.
  887. Parent string `json:"parent,omitempty"`
  888. // ProjectId: Deprecated. The Google Developers Console [project ID or
  889. // project
  890. // number](https://support.google.com/cloud/answer/6158840).
  891. // This
  892. // field has been deprecated and replaced by the parent field.
  893. ProjectId string `json:"projectId,omitempty"`
  894. // Zone: Deprecated. The name of the Google Compute
  895. // Engine
  896. // [zone](/compute/docs/zones#available) in which the
  897. // cluster
  898. // resides.
  899. // This field has been deprecated and replaced by the parent field.
  900. Zone string `json:"zone,omitempty"`
  901. // ForceSendFields is a list of field names (e.g. "Cluster") to
  902. // unconditionally include in API requests. By default, fields with
  903. // empty values are omitted from API requests. However, any non-pointer,
  904. // non-interface field appearing in ForceSendFields will be sent to the
  905. // server regardless of whether the field is empty or not. This may be
  906. // used to include empty fields in Patch requests.
  907. ForceSendFields []string `json:"-"`
  908. // NullFields is a list of field names (e.g. "Cluster") to include in
  909. // API requests with the JSON null value. By default, fields with empty
  910. // values are omitted from API requests. However, any field with an
  911. // empty value appearing in NullFields will be sent to the server as
  912. // null. It is an error if a field in this list has a non-empty value.
  913. // This may be used to include null fields in Patch requests.
  914. NullFields []string `json:"-"`
  915. }
  916. func (s *CreateClusterRequest) MarshalJSON() ([]byte, error) {
  917. type NoMethod CreateClusterRequest
  918. raw := NoMethod(*s)
  919. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  920. }
  921. // CreateNodePoolRequest: CreateNodePoolRequest creates a node pool for
  922. // a cluster.
  923. type CreateNodePoolRequest struct {
  924. // ClusterId: Deprecated. The name of the cluster.
  925. // This field has been deprecated and replaced by the parent field.
  926. ClusterId string `json:"clusterId,omitempty"`
  927. // NodePool: The node pool to create.
  928. NodePool *NodePool `json:"nodePool,omitempty"`
  929. // Parent: The parent (project, location, cluster id) where the node
  930. // pool will be
  931. // created. Specified in the format
  932. // 'projects/*/locations/*/clusters/*'.
  933. Parent string `json:"parent,omitempty"`
  934. // ProjectId: Deprecated. The Google Developers Console [project ID or
  935. // project
  936. // number](https://developers.google.com/console/help/new/#projec
  937. // tnumber).
  938. // This field has been deprecated and replaced by the parent field.
  939. ProjectId string `json:"projectId,omitempty"`
  940. // Zone: Deprecated. The name of the Google Compute
  941. // Engine
  942. // [zone](/compute/docs/zones#available) in which the
  943. // cluster
  944. // resides.
  945. // This field has been deprecated and replaced by the parent field.
  946. Zone string `json:"zone,omitempty"`
  947. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  948. // unconditionally include in API requests. By default, fields with
  949. // empty values are omitted from API requests. However, any non-pointer,
  950. // non-interface field appearing in ForceSendFields will be sent to the
  951. // server regardless of whether the field is empty or not. This may be
  952. // used to include empty fields in Patch requests.
  953. ForceSendFields []string `json:"-"`
  954. // NullFields is a list of field names (e.g. "ClusterId") to include in
  955. // API requests with the JSON null value. By default, fields with empty
  956. // values are omitted from API requests. However, any field with an
  957. // empty value appearing in NullFields will be sent to the server as
  958. // null. It is an error if a field in this list has a non-empty value.
  959. // This may be used to include null fields in Patch requests.
  960. NullFields []string `json:"-"`
  961. }
  962. func (s *CreateNodePoolRequest) MarshalJSON() ([]byte, error) {
  963. type NoMethod CreateNodePoolRequest
  964. raw := NoMethod(*s)
  965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  966. }
  967. // DailyMaintenanceWindow: Time window specified for daily maintenance
  968. // operations.
  969. type DailyMaintenanceWindow struct {
  970. // Duration: [Output only] Duration of the time window, automatically
  971. // chosen to be
  972. // smallest possible in the given scenario.
  973. // Duration will be in
  974. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt)
  975. // format "PTnHnMnS".
  976. Duration string `json:"duration,omitempty"`
  977. // StartTime: Time within the maintenance window to start the
  978. // maintenance operations.
  979. // Time format should be in
  980. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt)
  981. // format "HH:MM", where HH : [00-23] and MM : [00-59] GMT.
  982. StartTime string `json:"startTime,omitempty"`
  983. // ForceSendFields is a list of field names (e.g. "Duration") to
  984. // unconditionally include in API requests. By default, fields with
  985. // empty values are omitted from API requests. However, any non-pointer,
  986. // non-interface field appearing in ForceSendFields will be sent to the
  987. // server regardless of whether the field is empty or not. This may be
  988. // used to include empty fields in Patch requests.
  989. ForceSendFields []string `json:"-"`
  990. // NullFields is a list of field names (e.g. "Duration") to include in
  991. // API requests with the JSON null value. By default, fields with empty
  992. // values are omitted from API requests. However, any field with an
  993. // empty value appearing in NullFields will be sent to the server as
  994. // null. It is an error if a field in this list has a non-empty value.
  995. // This may be used to include null fields in Patch requests.
  996. NullFields []string `json:"-"`
  997. }
  998. func (s *DailyMaintenanceWindow) MarshalJSON() ([]byte, error) {
  999. type NoMethod DailyMaintenanceWindow
  1000. raw := NoMethod(*s)
  1001. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1002. }
  1003. // Empty: A generic empty message that you can re-use to avoid defining
  1004. // duplicated
  1005. // empty messages in your APIs. A typical example is to use it as the
  1006. // request
  1007. // or the response type of an API method. For instance:
  1008. //
  1009. // service Foo {
  1010. // rpc Bar(google.protobuf.Empty) returns
  1011. // (google.protobuf.Empty);
  1012. // }
  1013. //
  1014. // The JSON representation for `Empty` is empty JSON object `{}`.
  1015. type Empty struct {
  1016. // ServerResponse contains the HTTP response code and headers from the
  1017. // server.
  1018. googleapi.ServerResponse `json:"-"`
  1019. }
  1020. // GetJSONWebKeysResponse: GetJSONWebKeysResponse is a valid JSON Web
  1021. // Key Set as specififed in rfc 7517
  1022. type GetJSONWebKeysResponse struct {
  1023. // Keys: The public component of the keys used by the cluster to sign
  1024. // token
  1025. // requests.
  1026. Keys []*Jwk `json:"keys,omitempty"`
  1027. // ServerResponse contains the HTTP response code and headers from the
  1028. // server.
  1029. googleapi.ServerResponse `json:"-"`
  1030. // ForceSendFields is a list of field names (e.g. "Keys") to
  1031. // unconditionally include in API requests. By default, fields with
  1032. // empty values are omitted from API requests. However, any non-pointer,
  1033. // non-interface field appearing in ForceSendFields will be sent to the
  1034. // server regardless of whether the field is empty or not. This may be
  1035. // used to include empty fields in Patch requests.
  1036. ForceSendFields []string `json:"-"`
  1037. // NullFields is a list of field names (e.g. "Keys") to include in API
  1038. // requests with the JSON null value. By default, fields with empty
  1039. // values are omitted from API requests. However, any field with an
  1040. // empty value appearing in NullFields will be sent to the server as
  1041. // null. It is an error if a field in this list has a non-empty value.
  1042. // This may be used to include null fields in Patch requests.
  1043. NullFields []string `json:"-"`
  1044. }
  1045. func (s *GetJSONWebKeysResponse) MarshalJSON() ([]byte, error) {
  1046. type NoMethod GetJSONWebKeysResponse
  1047. raw := NoMethod(*s)
  1048. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1049. }
  1050. // GetOpenIDConfigResponse: GetOpenIDConfigResponse is an OIDC discovery
  1051. // document for the cluster.
  1052. // See the OpenID Connect Discovery 1.0 specification for details.
  1053. type GetOpenIDConfigResponse struct {
  1054. // ClaimsSupported: Supported claims.
  1055. ClaimsSupported []string `json:"claims_supported,omitempty"`
  1056. // GrantTypes: Supported grant types.
  1057. GrantTypes []string `json:"grant_types,omitempty"`
  1058. // IdTokenSigningAlgValuesSupported: supported ID Token signing
  1059. // Algorithms.
  1060. IdTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported,omitempty"`
  1061. // Issuer: OIDC Issuer.
  1062. Issuer string `json:"issuer,omitempty"`
  1063. // JwksUri: JSON Web Key uri.
  1064. JwksUri string `json:"jwks_uri,omitempty"`
  1065. // ResponseTypesSupported: Supported response types.
  1066. ResponseTypesSupported []string `json:"response_types_supported,omitempty"`
  1067. // SubjectTypesSupported: Supported subject types.
  1068. SubjectTypesSupported []string `json:"subject_types_supported,omitempty"`
  1069. // ServerResponse contains the HTTP response code and headers from the
  1070. // server.
  1071. googleapi.ServerResponse `json:"-"`
  1072. // ForceSendFields is a list of field names (e.g. "ClaimsSupported") to
  1073. // unconditionally include in API requests. By default, fields with
  1074. // empty values are omitted from API requests. However, any non-pointer,
  1075. // non-interface field appearing in ForceSendFields will be sent to the
  1076. // server regardless of whether the field is empty or not. This may be
  1077. // used to include empty fields in Patch requests.
  1078. ForceSendFields []string `json:"-"`
  1079. // NullFields is a list of field names (e.g. "ClaimsSupported") to
  1080. // include in API requests with the JSON null value. By default, fields
  1081. // with empty values are omitted from API requests. However, any field
  1082. // with an empty value appearing in NullFields will be sent to the
  1083. // server as null. It is an error if a field in this list has a
  1084. // non-empty value. This may be used to include null fields in Patch
  1085. // requests.
  1086. NullFields []string `json:"-"`
  1087. }
  1088. func (s *GetOpenIDConfigResponse) MarshalJSON() ([]byte, error) {
  1089. type NoMethod GetOpenIDConfigResponse
  1090. raw := NoMethod(*s)
  1091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1092. }
  1093. // HorizontalPodAutoscaling: Configuration options for the horizontal
  1094. // pod autoscaling feature, which
  1095. // increases or decreases the number of replica pods a replication
  1096. // controller
  1097. // has based on the resource usage of the existing pods.
  1098. type HorizontalPodAutoscaling struct {
  1099. // Disabled: Whether the Horizontal Pod Autoscaling feature is enabled
  1100. // in the cluster.
  1101. // When enabled, it ensures that a Heapster pod is running in the
  1102. // cluster,
  1103. // which is also used by the Cloud Monitoring service.
  1104. Disabled bool `json:"disabled,omitempty"`
  1105. // ForceSendFields is a list of field names (e.g. "Disabled") to
  1106. // unconditionally include in API requests. By default, fields with
  1107. // empty values are omitted from API requests. However, any non-pointer,
  1108. // non-interface field appearing in ForceSendFields will be sent to the
  1109. // server regardless of whether the field is empty or not. This may be
  1110. // used to include empty fields in Patch requests.
  1111. ForceSendFields []string `json:"-"`
  1112. // NullFields is a list of field names (e.g. "Disabled") to include in
  1113. // API requests with the JSON null value. By default, fields with empty
  1114. // values are omitted from API requests. However, any field with an
  1115. // empty value appearing in NullFields will be sent to the server as
  1116. // null. It is an error if a field in this list has a non-empty value.
  1117. // This may be used to include null fields in Patch requests.
  1118. NullFields []string `json:"-"`
  1119. }
  1120. func (s *HorizontalPodAutoscaling) MarshalJSON() ([]byte, error) {
  1121. type NoMethod HorizontalPodAutoscaling
  1122. raw := NoMethod(*s)
  1123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1124. }
  1125. // HttpLoadBalancing: Configuration options for the HTTP (L7) load
  1126. // balancing controller addon,
  1127. // which makes it easy to set up HTTP load balancers for services in a
  1128. // cluster.
  1129. type HttpLoadBalancing struct {
  1130. // Disabled: Whether the HTTP Load Balancing controller is enabled in
  1131. // the cluster.
  1132. // When enabled, it runs a small pod in the cluster that manages the
  1133. // load
  1134. // balancers.
  1135. Disabled bool `json:"disabled,omitempty"`
  1136. // ForceSendFields is a list of field names (e.g. "Disabled") to
  1137. // unconditionally include in API requests. By default, fields with
  1138. // empty values are omitted from API requests. However, any non-pointer,
  1139. // non-interface field appearing in ForceSendFields will be sent to the
  1140. // server regardless of whether the field is empty or not. This may be
  1141. // used to include empty fields in Patch requests.
  1142. ForceSendFields []string `json:"-"`
  1143. // NullFields is a list of field names (e.g. "Disabled") to include in
  1144. // API requests with the JSON null value. By default, fields with empty
  1145. // values are omitted from API requests. However, any field with an
  1146. // empty value appearing in NullFields will be sent to the server as
  1147. // null. It is an error if a field in this list has a non-empty value.
  1148. // This may be used to include null fields in Patch requests.
  1149. NullFields []string `json:"-"`
  1150. }
  1151. func (s *HttpLoadBalancing) MarshalJSON() ([]byte, error) {
  1152. type NoMethod HttpLoadBalancing
  1153. raw := NoMethod(*s)
  1154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1155. }
  1156. // IPAllocationPolicy: Configuration for controlling how IPs are
  1157. // allocated in the cluster.
  1158. type IPAllocationPolicy struct {
  1159. // ClusterIpv4Cidr: This field is deprecated, use
  1160. // cluster_ipv4_cidr_block.
  1161. ClusterIpv4Cidr string `json:"clusterIpv4Cidr,omitempty"`
  1162. // ClusterIpv4CidrBlock: The IP address range for the cluster pod IPs.
  1163. // If this field is set, then
  1164. // `cluster.cluster_ipv4_cidr` must be left blank.
  1165. //
  1166. // This field is only applicable when `use_ip_aliases` is true.
  1167. //
  1168. // Set to blank to have a range chosen with the default size.
  1169. //
  1170. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1171. // specific
  1172. // netmask.
  1173. //
  1174. // Set to
  1175. // a
  1176. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1177. //
  1178. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1179. // (e.g.
  1180. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1181. // range
  1182. // to use.
  1183. ClusterIpv4CidrBlock string `json:"clusterIpv4CidrBlock,omitempty"`
  1184. // ClusterSecondaryRangeName: The name of the secondary range to be used
  1185. // for the cluster CIDR
  1186. // block. The secondary range will be used for pod IP
  1187. // addresses. This must be an existing secondary range associated
  1188. // with the cluster subnetwork.
  1189. //
  1190. // This field is only applicable with use_ip_aliases is true
  1191. // and
  1192. // create_subnetwork is false.
  1193. ClusterSecondaryRangeName string `json:"clusterSecondaryRangeName,omitempty"`
  1194. // CreateSubnetwork: Whether a new subnetwork will be created
  1195. // automatically for the cluster.
  1196. //
  1197. // This field is only applicable when `use_ip_aliases` is true.
  1198. CreateSubnetwork bool `json:"createSubnetwork,omitempty"`
  1199. // NodeIpv4Cidr: This field is deprecated, use node_ipv4_cidr_block.
  1200. NodeIpv4Cidr string `json:"nodeIpv4Cidr,omitempty"`
  1201. // NodeIpv4CidrBlock: The IP address range of the instance IPs in this
  1202. // cluster.
  1203. //
  1204. // This is applicable only if `create_subnetwork` is true.
  1205. //
  1206. // Set to blank to have a range chosen with the default size.
  1207. //
  1208. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1209. // specific
  1210. // netmask.
  1211. //
  1212. // Set to
  1213. // a
  1214. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1215. //
  1216. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1217. // (e.g.
  1218. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1219. // range
  1220. // to use.
  1221. NodeIpv4CidrBlock string `json:"nodeIpv4CidrBlock,omitempty"`
  1222. // ServicesIpv4Cidr: This field is deprecated, use
  1223. // services_ipv4_cidr_block.
  1224. ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"`
  1225. // ServicesIpv4CidrBlock: The IP address range of the services IPs in
  1226. // this cluster. If blank, a range
  1227. // will be automatically chosen with the default size.
  1228. //
  1229. // This field is only applicable when `use_ip_aliases` is true.
  1230. //
  1231. // Set to blank to have a range chosen with the default size.
  1232. //
  1233. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1234. // specific
  1235. // netmask.
  1236. //
  1237. // Set to
  1238. // a
  1239. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1240. //
  1241. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1242. // (e.g.
  1243. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1244. // range
  1245. // to use.
  1246. ServicesIpv4CidrBlock string `json:"servicesIpv4CidrBlock,omitempty"`
  1247. // ServicesSecondaryRangeName: The name of the secondary range to be
  1248. // used as for the services
  1249. // CIDR block. The secondary range will be used for service
  1250. // ClusterIPs. This must be an existing secondary range associated
  1251. // with the cluster subnetwork.
  1252. //
  1253. // This field is only applicable with use_ip_aliases is true
  1254. // and
  1255. // create_subnetwork is false.
  1256. ServicesSecondaryRangeName string `json:"servicesSecondaryRangeName,omitempty"`
  1257. // SubnetworkName: A custom subnetwork name to be used if
  1258. // `create_subnetwork` is true. If
  1259. // this field is empty, then an automatic name will be chosen for the
  1260. // new
  1261. // subnetwork.
  1262. SubnetworkName string `json:"subnetworkName,omitempty"`
  1263. // TpuIpv4CidrBlock: The IP address range of the Cloud TPUs in this
  1264. // cluster. If unspecified, a
  1265. // range will be automatically chosen with the default size.
  1266. //
  1267. // This field is only applicable when `use_ip_aliases` is true.
  1268. //
  1269. // If unspecified, the range will use the default size.
  1270. //
  1271. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1272. // specific
  1273. // netmask.
  1274. //
  1275. // Set to
  1276. // a
  1277. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1278. //
  1279. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1280. // (e.g.
  1281. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1282. // range
  1283. // to use.
  1284. TpuIpv4CidrBlock string `json:"tpuIpv4CidrBlock,omitempty"`
  1285. // UseIpAliases: Whether alias IPs will be used for pod IPs in the
  1286. // cluster.
  1287. UseIpAliases bool `json:"useIpAliases,omitempty"`
  1288. // ForceSendFields is a list of field names (e.g. "ClusterIpv4Cidr") to
  1289. // unconditionally include in API requests. By default, fields with
  1290. // empty values are omitted from API requests. However, any non-pointer,
  1291. // non-interface field appearing in ForceSendFields will be sent to the
  1292. // server regardless of whether the field is empty or not. This may be
  1293. // used to include empty fields in Patch requests.
  1294. ForceSendFields []string `json:"-"`
  1295. // NullFields is a list of field names (e.g. "ClusterIpv4Cidr") to
  1296. // include in API requests with the JSON null value. By default, fields
  1297. // with empty values are omitted from API requests. However, any field
  1298. // with an empty value appearing in NullFields will be sent to the
  1299. // server as null. It is an error if a field in this list has a
  1300. // non-empty value. This may be used to include null fields in Patch
  1301. // requests.
  1302. NullFields []string `json:"-"`
  1303. }
  1304. func (s *IPAllocationPolicy) MarshalJSON() ([]byte, error) {
  1305. type NoMethod IPAllocationPolicy
  1306. raw := NoMethod(*s)
  1307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1308. }
  1309. // Jwk: Jwk is a JSON Web Key as specified in RFC 7517
  1310. type Jwk struct {
  1311. // Alg: Algorithm.
  1312. Alg string `json:"alg,omitempty"`
  1313. // Crv: Used for ECDSA keys.
  1314. Crv string `json:"crv,omitempty"`
  1315. // E: Used for RSA keys.
  1316. E string `json:"e,omitempty"`
  1317. // Kid: Key ID.
  1318. Kid string `json:"kid,omitempty"`
  1319. // Kty: Key Type.
  1320. Kty string `json:"kty,omitempty"`
  1321. // N: Used for RSA keys.
  1322. N string `json:"n,omitempty"`
  1323. // Use: Permitted uses for the public keys.
  1324. Use string `json:"use,omitempty"`
  1325. // X: Used for ECDSA keys.
  1326. X string `json:"x,omitempty"`
  1327. // Y: Used for ECDSA keys.
  1328. Y string `json:"y,omitempty"`
  1329. // ForceSendFields is a list of field names (e.g. "Alg") to
  1330. // unconditionally include in API requests. By default, fields with
  1331. // empty values are omitted from API requests. However, any non-pointer,
  1332. // non-interface field appearing in ForceSendFields will be sent to the
  1333. // server regardless of whether the field is empty or not. This may be
  1334. // used to include empty fields in Patch requests.
  1335. ForceSendFields []string `json:"-"`
  1336. // NullFields is a list of field names (e.g. "Alg") to include in API
  1337. // requests with the JSON null value. By default, fields with empty
  1338. // values are omitted from API requests. However, any field with an
  1339. // empty value appearing in NullFields will be sent to the server as
  1340. // null. It is an error if a field in this list has a non-empty value.
  1341. // This may be used to include null fields in Patch requests.
  1342. NullFields []string `json:"-"`
  1343. }
  1344. func (s *Jwk) MarshalJSON() ([]byte, error) {
  1345. type NoMethod Jwk
  1346. raw := NoMethod(*s)
  1347. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1348. }
  1349. // KubernetesDashboard: Configuration for the Kubernetes Dashboard.
  1350. type KubernetesDashboard struct {
  1351. // Disabled: Whether the Kubernetes Dashboard is enabled for this
  1352. // cluster.
  1353. Disabled bool `json:"disabled,omitempty"`
  1354. // ForceSendFields is a list of field names (e.g. "Disabled") to
  1355. // unconditionally include in API requests. By default, fields with
  1356. // empty values are omitted from API requests. However, any non-pointer,
  1357. // non-interface field appearing in ForceSendFields will be sent to the
  1358. // server regardless of whether the field is empty or not. This may be
  1359. // used to include empty fields in Patch requests.
  1360. ForceSendFields []string `json:"-"`
  1361. // NullFields is a list of field names (e.g. "Disabled") to include in
  1362. // API requests with the JSON null value. By default, fields with empty
  1363. // values are omitted from API requests. However, any field with an
  1364. // empty value appearing in NullFields will be sent to the server as
  1365. // null. It is an error if a field in this list has a non-empty value.
  1366. // This may be used to include null fields in Patch requests.
  1367. NullFields []string `json:"-"`
  1368. }
  1369. func (s *KubernetesDashboard) MarshalJSON() ([]byte, error) {
  1370. type NoMethod KubernetesDashboard
  1371. raw := NoMethod(*s)
  1372. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1373. }
  1374. // LegacyAbac: Configuration for the legacy Attribute Based Access
  1375. // Control authorization
  1376. // mode.
  1377. type LegacyAbac struct {
  1378. // Enabled: Whether the ABAC authorizer is enabled for this cluster.
  1379. // When enabled,
  1380. // identities in the system, including service accounts, nodes,
  1381. // and
  1382. // controllers, will have statically granted permissions beyond
  1383. // those
  1384. // provided by the RBAC configuration or IAM.
  1385. Enabled bool `json:"enabled,omitempty"`
  1386. // ForceSendFields is a list of field names (e.g. "Enabled") to
  1387. // unconditionally include in API requests. By default, fields with
  1388. // empty values are omitted from API requests. However, any non-pointer,
  1389. // non-interface field appearing in ForceSendFields will be sent to the
  1390. // server regardless of whether the field is empty or not. This may be
  1391. // used to include empty fields in Patch requests.
  1392. ForceSendFields []string `json:"-"`
  1393. // NullFields is a list of field names (e.g. "Enabled") to include in
  1394. // API requests with the JSON null value. By default, fields with empty
  1395. // values are omitted from API requests. However, any field with an
  1396. // empty value appearing in NullFields will be sent to the server as
  1397. // null. It is an error if a field in this list has a non-empty value.
  1398. // This may be used to include null fields in Patch requests.
  1399. NullFields []string `json:"-"`
  1400. }
  1401. func (s *LegacyAbac) MarshalJSON() ([]byte, error) {
  1402. type NoMethod LegacyAbac
  1403. raw := NoMethod(*s)
  1404. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1405. }
  1406. // ListClustersResponse: ListClustersResponse is the result of
  1407. // ListClustersRequest.
  1408. type ListClustersResponse struct {
  1409. // Clusters: A list of clusters in the project in the specified zone,
  1410. // or
  1411. // across all ones.
  1412. Clusters []*Cluster `json:"clusters,omitempty"`
  1413. // MissingZones: If any zones are listed here, the list of clusters
  1414. // returned
  1415. // may be missing those zones.
  1416. MissingZones []string `json:"missingZones,omitempty"`
  1417. // ServerResponse contains the HTTP response code and headers from the
  1418. // server.
  1419. googleapi.ServerResponse `json:"-"`
  1420. // ForceSendFields is a list of field names (e.g. "Clusters") to
  1421. // unconditionally include in API requests. By default, fields with
  1422. // empty values are omitted from API requests. However, any non-pointer,
  1423. // non-interface field appearing in ForceSendFields will be sent to the
  1424. // server regardless of whether the field is empty or not. This may be
  1425. // used to include empty fields in Patch requests.
  1426. ForceSendFields []string `json:"-"`
  1427. // NullFields is a list of field names (e.g. "Clusters") to include in
  1428. // API requests with the JSON null value. By default, fields with empty
  1429. // values are omitted from API requests. However, any field with an
  1430. // empty value appearing in NullFields will be sent to the server as
  1431. // null. It is an error if a field in this list has a non-empty value.
  1432. // This may be used to include null fields in Patch requests.
  1433. NullFields []string `json:"-"`
  1434. }
  1435. func (s *ListClustersResponse) MarshalJSON() ([]byte, error) {
  1436. type NoMethod ListClustersResponse
  1437. raw := NoMethod(*s)
  1438. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1439. }
  1440. // ListNodePoolsResponse: ListNodePoolsResponse is the result of
  1441. // ListNodePoolsRequest.
  1442. type ListNodePoolsResponse struct {
  1443. // NodePools: A list of node pools for a cluster.
  1444. NodePools []*NodePool `json:"nodePools,omitempty"`
  1445. // ServerResponse contains the HTTP response code and headers from the
  1446. // server.
  1447. googleapi.ServerResponse `json:"-"`
  1448. // ForceSendFields is a list of field names (e.g. "NodePools") to
  1449. // unconditionally include in API requests. By default, fields with
  1450. // empty values are omitted from API requests. However, any non-pointer,
  1451. // non-interface field appearing in ForceSendFields will be sent to the
  1452. // server regardless of whether the field is empty or not. This may be
  1453. // used to include empty fields in Patch requests.
  1454. ForceSendFields []string `json:"-"`
  1455. // NullFields is a list of field names (e.g. "NodePools") to include in
  1456. // API requests with the JSON null value. By default, fields with empty
  1457. // values are omitted from API requests. However, any field with an
  1458. // empty value appearing in NullFields will be sent to the server as
  1459. // null. It is an error if a field in this list has a non-empty value.
  1460. // This may be used to include null fields in Patch requests.
  1461. NullFields []string `json:"-"`
  1462. }
  1463. func (s *ListNodePoolsResponse) MarshalJSON() ([]byte, error) {
  1464. type NoMethod ListNodePoolsResponse
  1465. raw := NoMethod(*s)
  1466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1467. }
  1468. // ListOperationsResponse: ListOperationsResponse is the result of
  1469. // ListOperationsRequest.
  1470. type ListOperationsResponse struct {
  1471. // MissingZones: If any zones are listed here, the list of operations
  1472. // returned
  1473. // may be missing the operations from those zones.
  1474. MissingZones []string `json:"missingZones,omitempty"`
  1475. // Operations: A list of operations in the project in the specified
  1476. // zone.
  1477. Operations []*Operation `json:"operations,omitempty"`
  1478. // ServerResponse contains the HTTP response code and headers from the
  1479. // server.
  1480. googleapi.ServerResponse `json:"-"`
  1481. // ForceSendFields is a list of field names (e.g. "MissingZones") to
  1482. // unconditionally include in API requests. By default, fields with
  1483. // empty values are omitted from API requests. However, any non-pointer,
  1484. // non-interface field appearing in ForceSendFields will be sent to the
  1485. // server regardless of whether the field is empty or not. This may be
  1486. // used to include empty fields in Patch requests.
  1487. ForceSendFields []string `json:"-"`
  1488. // NullFields is a list of field names (e.g. "MissingZones") to include
  1489. // in API requests with the JSON null value. By default, fields with
  1490. // empty values are omitted from API requests. However, any field with
  1491. // an empty value appearing in NullFields will be sent to the server as
  1492. // null. It is an error if a field in this list has a non-empty value.
  1493. // This may be used to include null fields in Patch requests.
  1494. NullFields []string `json:"-"`
  1495. }
  1496. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  1497. type NoMethod ListOperationsResponse
  1498. raw := NoMethod(*s)
  1499. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1500. }
  1501. // ListUsableSubnetworksResponse: ListUsableSubnetworksResponse is the
  1502. // response of
  1503. // ListUsableSubnetworksRequest.
  1504. type ListUsableSubnetworksResponse struct {
  1505. // NextPageToken: This token allows you to get the next page of results
  1506. // for list requests.
  1507. // If the number of results is larger than `page_size`, use
  1508. // the
  1509. // `next_page_token` as a value for the query parameter `page_token` in
  1510. // the
  1511. // next request. The value will become empty when there are no more
  1512. // pages.
  1513. NextPageToken string `json:"nextPageToken,omitempty"`
  1514. // Subnetworks: A list of usable subnetworks in the specified network
  1515. // project.
  1516. Subnetworks []*UsableSubnetwork `json:"subnetworks,omitempty"`
  1517. // ServerResponse contains the HTTP response code and headers from the
  1518. // server.
  1519. googleapi.ServerResponse `json:"-"`
  1520. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1521. // unconditionally include in API requests. By default, fields with
  1522. // empty values are omitted from API requests. However, any non-pointer,
  1523. // non-interface field appearing in ForceSendFields will be sent to the
  1524. // server regardless of whether the field is empty or not. This may be
  1525. // used to include empty fields in Patch requests.
  1526. ForceSendFields []string `json:"-"`
  1527. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1528. // in API requests with the JSON null value. By default, fields with
  1529. // empty values are omitted from API requests. However, any field with
  1530. // an empty value appearing in NullFields will be sent to the server as
  1531. // null. It is an error if a field in this list has a non-empty value.
  1532. // This may be used to include null fields in Patch requests.
  1533. NullFields []string `json:"-"`
  1534. }
  1535. func (s *ListUsableSubnetworksResponse) MarshalJSON() ([]byte, error) {
  1536. type NoMethod ListUsableSubnetworksResponse
  1537. raw := NoMethod(*s)
  1538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1539. }
  1540. // MaintenancePolicy: MaintenancePolicy defines the maintenance policy
  1541. // to be used for the cluster.
  1542. type MaintenancePolicy struct {
  1543. // Window: Specifies the maintenance window in which maintenance may be
  1544. // performed.
  1545. Window *MaintenanceWindow `json:"window,omitempty"`
  1546. // ForceSendFields is a list of field names (e.g. "Window") to
  1547. // unconditionally include in API requests. By default, fields with
  1548. // empty values are omitted from API requests. However, any non-pointer,
  1549. // non-interface field appearing in ForceSendFields will be sent to the
  1550. // server regardless of whether the field is empty or not. This may be
  1551. // used to include empty fields in Patch requests.
  1552. ForceSendFields []string `json:"-"`
  1553. // NullFields is a list of field names (e.g. "Window") to include in API
  1554. // requests with the JSON null value. By default, fields with empty
  1555. // values are omitted from API requests. However, any field with an
  1556. // empty value appearing in NullFields will be sent to the server as
  1557. // null. It is an error if a field in this list has a non-empty value.
  1558. // This may be used to include null fields in Patch requests.
  1559. NullFields []string `json:"-"`
  1560. }
  1561. func (s *MaintenancePolicy) MarshalJSON() ([]byte, error) {
  1562. type NoMethod MaintenancePolicy
  1563. raw := NoMethod(*s)
  1564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1565. }
  1566. // MaintenanceWindow: MaintenanceWindow defines the maintenance window
  1567. // to be used for the cluster.
  1568. type MaintenanceWindow struct {
  1569. // DailyMaintenanceWindow: DailyMaintenanceWindow specifies a daily
  1570. // maintenance operation window.
  1571. DailyMaintenanceWindow *DailyMaintenanceWindow `json:"dailyMaintenanceWindow,omitempty"`
  1572. // ForceSendFields is a list of field names (e.g.
  1573. // "DailyMaintenanceWindow") to unconditionally include in API requests.
  1574. // By default, fields with empty values are omitted from API requests.
  1575. // However, any non-pointer, non-interface field appearing in
  1576. // ForceSendFields will be sent to the server regardless of whether the
  1577. // field is empty or not. This may be used to include empty fields in
  1578. // Patch requests.
  1579. ForceSendFields []string `json:"-"`
  1580. // NullFields is a list of field names (e.g. "DailyMaintenanceWindow")
  1581. // to include in API requests with the JSON null value. By default,
  1582. // fields with empty values are omitted from API requests. However, any
  1583. // field with an empty value appearing in NullFields will be sent to the
  1584. // server as null. It is an error if a field in this list has a
  1585. // non-empty value. This may be used to include null fields in Patch
  1586. // requests.
  1587. NullFields []string `json:"-"`
  1588. }
  1589. func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) {
  1590. type NoMethod MaintenanceWindow
  1591. raw := NoMethod(*s)
  1592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1593. }
  1594. // MasterAuth: The authentication information for accessing the master
  1595. // endpoint.
  1596. // Authentication can be done using HTTP basic auth or using
  1597. // client
  1598. // certificates.
  1599. type MasterAuth struct {
  1600. // ClientCertificate: [Output only] Base64-encoded public certificate
  1601. // used by clients to
  1602. // authenticate to the cluster endpoint.
  1603. ClientCertificate string `json:"clientCertificate,omitempty"`
  1604. // ClientCertificateConfig: Configuration for client certificate
  1605. // authentication on the cluster. For
  1606. // clusters before v1.12, if no configuration is specified, a
  1607. // client
  1608. // certificate is issued.
  1609. ClientCertificateConfig *ClientCertificateConfig `json:"clientCertificateConfig,omitempty"`
  1610. // ClientKey: [Output only] Base64-encoded private key used by clients
  1611. // to authenticate
  1612. // to the cluster endpoint.
  1613. ClientKey string `json:"clientKey,omitempty"`
  1614. // ClusterCaCertificate: [Output only] Base64-encoded public certificate
  1615. // that is the root of
  1616. // trust for the cluster.
  1617. ClusterCaCertificate string `json:"clusterCaCertificate,omitempty"`
  1618. // Password: The password to use for HTTP basic authentication to the
  1619. // master endpoint.
  1620. // Because the master endpoint is open to the Internet, you should
  1621. // create a
  1622. // strong password. If a password is provided for cluster creation,
  1623. // username
  1624. // must be non-empty.
  1625. Password string `json:"password,omitempty"`
  1626. // Username: The username to use for HTTP basic authentication to the
  1627. // master endpoint.
  1628. // For clusters v1.6.0 and later, basic authentication can be disabled
  1629. // by
  1630. // leaving username unspecified (or setting it to the empty string).
  1631. Username string `json:"username,omitempty"`
  1632. // ForceSendFields is a list of field names (e.g. "ClientCertificate")
  1633. // to unconditionally include in API requests. By default, fields with
  1634. // empty values are omitted from API requests. However, any non-pointer,
  1635. // non-interface field appearing in ForceSendFields will be sent to the
  1636. // server regardless of whether the field is empty or not. This may be
  1637. // used to include empty fields in Patch requests.
  1638. ForceSendFields []string `json:"-"`
  1639. // NullFields is a list of field names (e.g. "ClientCertificate") to
  1640. // include in API requests with the JSON null value. By default, fields
  1641. // with empty values are omitted from API requests. However, any field
  1642. // with an empty value appearing in NullFields will be sent to the
  1643. // server as null. It is an error if a field in this list has a
  1644. // non-empty value. This may be used to include null fields in Patch
  1645. // requests.
  1646. NullFields []string `json:"-"`
  1647. }
  1648. func (s *MasterAuth) MarshalJSON() ([]byte, error) {
  1649. type NoMethod MasterAuth
  1650. raw := NoMethod(*s)
  1651. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1652. }
  1653. // MasterAuthorizedNetworksConfig: Configuration options for the master
  1654. // authorized networks feature. Enabled
  1655. // master authorized networks will disallow all external traffic to
  1656. // access
  1657. // Kubernetes master through HTTPS except traffic from the given CIDR
  1658. // blocks,
  1659. // Google Compute Engine Public IPs and Google Prod IPs.
  1660. type MasterAuthorizedNetworksConfig struct {
  1661. // CidrBlocks: cidr_blocks define up to 50 external networks that could
  1662. // access
  1663. // Kubernetes master through HTTPS.
  1664. CidrBlocks []*CidrBlock `json:"cidrBlocks,omitempty"`
  1665. // Enabled: Whether or not master authorized networks is enabled.
  1666. Enabled bool `json:"enabled,omitempty"`
  1667. // ForceSendFields is a list of field names (e.g. "CidrBlocks") to
  1668. // unconditionally include in API requests. By default, fields with
  1669. // empty values are omitted from API requests. However, any non-pointer,
  1670. // non-interface field appearing in ForceSendFields will be sent to the
  1671. // server regardless of whether the field is empty or not. This may be
  1672. // used to include empty fields in Patch requests.
  1673. ForceSendFields []string `json:"-"`
  1674. // NullFields is a list of field names (e.g. "CidrBlocks") to include in
  1675. // API requests with the JSON null value. By default, fields with empty
  1676. // values are omitted from API requests. However, any field with an
  1677. // empty value appearing in NullFields will be sent to the server as
  1678. // null. It is an error if a field in this list has a non-empty value.
  1679. // This may be used to include null fields in Patch requests.
  1680. NullFields []string `json:"-"`
  1681. }
  1682. func (s *MasterAuthorizedNetworksConfig) MarshalJSON() ([]byte, error) {
  1683. type NoMethod MasterAuthorizedNetworksConfig
  1684. raw := NoMethod(*s)
  1685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1686. }
  1687. // MaxPodsConstraint: Constraints applied to pods.
  1688. type MaxPodsConstraint struct {
  1689. // MaxPodsPerNode: Constraint enforced on the max num of pods per node.
  1690. MaxPodsPerNode int64 `json:"maxPodsPerNode,omitempty,string"`
  1691. // ForceSendFields is a list of field names (e.g. "MaxPodsPerNode") to
  1692. // unconditionally include in API requests. By default, fields with
  1693. // empty values are omitted from API requests. However, any non-pointer,
  1694. // non-interface field appearing in ForceSendFields will be sent to the
  1695. // server regardless of whether the field is empty or not. This may be
  1696. // used to include empty fields in Patch requests.
  1697. ForceSendFields []string `json:"-"`
  1698. // NullFields is a list of field names (e.g. "MaxPodsPerNode") to
  1699. // include in API requests with the JSON null value. By default, fields
  1700. // with empty values are omitted from API requests. However, any field
  1701. // with an empty value appearing in NullFields will be sent to the
  1702. // server as null. It is an error if a field in this list has a
  1703. // non-empty value. This may be used to include null fields in Patch
  1704. // requests.
  1705. NullFields []string `json:"-"`
  1706. }
  1707. func (s *MaxPodsConstraint) MarshalJSON() ([]byte, error) {
  1708. type NoMethod MaxPodsConstraint
  1709. raw := NoMethod(*s)
  1710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1711. }
  1712. // NetworkConfig: NetworkConfig reports the relative names of network &
  1713. // subnetwork.
  1714. type NetworkConfig struct {
  1715. // Network: Output only. The relative name of the Google Compute
  1716. // Engine
  1717. // network(/compute/docs/networks-and-firewalls#networks) to which
  1718. // the cluster is connected.
  1719. // Example: projects/my-project/global/networks/my-network
  1720. Network string `json:"network,omitempty"`
  1721. // Subnetwork: Output only. The relative name of the Google Compute
  1722. // Engine
  1723. // [subnetwork](/compute/docs/vpc) to which the cluster is
  1724. // connected.
  1725. // Example:
  1726. // projects/my-project/regions/us-central1/subnetworks/my-subnet
  1727. Subnetwork string `json:"subnetwork,omitempty"`
  1728. // ForceSendFields is a list of field names (e.g. "Network") to
  1729. // unconditionally include in API requests. By default, fields with
  1730. // empty values are omitted from API requests. However, any non-pointer,
  1731. // non-interface field appearing in ForceSendFields will be sent to the
  1732. // server regardless of whether the field is empty or not. This may be
  1733. // used to include empty fields in Patch requests.
  1734. ForceSendFields []string `json:"-"`
  1735. // NullFields is a list of field names (e.g. "Network") to include in
  1736. // API requests with the JSON null value. By default, fields with empty
  1737. // values are omitted from API requests. However, any field with an
  1738. // empty value appearing in NullFields will be sent to the server as
  1739. // null. It is an error if a field in this list has a non-empty value.
  1740. // This may be used to include null fields in Patch requests.
  1741. NullFields []string `json:"-"`
  1742. }
  1743. func (s *NetworkConfig) MarshalJSON() ([]byte, error) {
  1744. type NoMethod NetworkConfig
  1745. raw := NoMethod(*s)
  1746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1747. }
  1748. // NetworkPolicy: Configuration options for the NetworkPolicy
  1749. // feature.
  1750. // https://kubernetes.io/docs/concepts/services-networking/netwo
  1751. // rkpolicies/
  1752. type NetworkPolicy struct {
  1753. // Enabled: Whether network policy is enabled on the cluster.
  1754. Enabled bool `json:"enabled,omitempty"`
  1755. // Provider: The selected network policy provider.
  1756. //
  1757. // Possible values:
  1758. // "PROVIDER_UNSPECIFIED" - Not set
  1759. // "CALICO" - Tigera (Calico Felix).
  1760. Provider string `json:"provider,omitempty"`
  1761. // ForceSendFields is a list of field names (e.g. "Enabled") to
  1762. // unconditionally include in API requests. By default, fields with
  1763. // empty values are omitted from API requests. However, any non-pointer,
  1764. // non-interface field appearing in ForceSendFields will be sent to the
  1765. // server regardless of whether the field is empty or not. This may be
  1766. // used to include empty fields in Patch requests.
  1767. ForceSendFields []string `json:"-"`
  1768. // NullFields is a list of field names (e.g. "Enabled") to include in
  1769. // API requests with the JSON null value. By default, fields with empty
  1770. // values are omitted from API requests. However, any field with an
  1771. // empty value appearing in NullFields will be sent to the server as
  1772. // null. It is an error if a field in this list has a non-empty value.
  1773. // This may be used to include null fields in Patch requests.
  1774. NullFields []string `json:"-"`
  1775. }
  1776. func (s *NetworkPolicy) MarshalJSON() ([]byte, error) {
  1777. type NoMethod NetworkPolicy
  1778. raw := NoMethod(*s)
  1779. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1780. }
  1781. // NetworkPolicyConfig: Configuration for NetworkPolicy. This only
  1782. // tracks whether the addon
  1783. // is enabled or not on the Master, it does not track whether network
  1784. // policy
  1785. // is enabled for the nodes.
  1786. type NetworkPolicyConfig struct {
  1787. // Disabled: Whether NetworkPolicy is enabled for this cluster.
  1788. Disabled bool `json:"disabled,omitempty"`
  1789. // ForceSendFields is a list of field names (e.g. "Disabled") 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. // NullFields is a list of field names (e.g. "Disabled") to include in
  1797. // API requests with the JSON null value. By default, fields with empty
  1798. // values are omitted from API requests. However, any field with an
  1799. // empty value appearing in NullFields will be sent to the server as
  1800. // null. It is an error if a field in this list has a non-empty value.
  1801. // This may be used to include null fields in Patch requests.
  1802. NullFields []string `json:"-"`
  1803. }
  1804. func (s *NetworkPolicyConfig) MarshalJSON() ([]byte, error) {
  1805. type NoMethod NetworkPolicyConfig
  1806. raw := NoMethod(*s)
  1807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1808. }
  1809. // NodeConfig: Parameters that describe the nodes in a cluster.
  1810. type NodeConfig struct {
  1811. // Accelerators: A list of hardware accelerators to be attached to each
  1812. // node.
  1813. // See https://cloud.google.com/compute/docs/gpus for more information
  1814. // about
  1815. // support for GPUs.
  1816. Accelerators []*AcceleratorConfig `json:"accelerators,omitempty"`
  1817. // DiskSizeGb: Size of the disk attached to each node, specified in
  1818. // GB.
  1819. // The smallest allowed disk size is 10GB.
  1820. //
  1821. // If unspecified, the default disk size is 100GB.
  1822. DiskSizeGb int64 `json:"diskSizeGb,omitempty"`
  1823. // DiskType: Type of the disk attached to each node (e.g. 'pd-standard'
  1824. // or 'pd-ssd')
  1825. //
  1826. // If unspecified, the default disk type is 'pd-standard'
  1827. DiskType string `json:"diskType,omitempty"`
  1828. // ImageType: The image type to use for this node. Note that for a given
  1829. // image type,
  1830. // the latest version of it will be used.
  1831. ImageType string `json:"imageType,omitempty"`
  1832. // Labels: The map of Kubernetes labels (key/value pairs) to be applied
  1833. // to each node.
  1834. // These will added in addition to any default label(s) that
  1835. // Kubernetes may apply to the node.
  1836. // In case of conflict in label keys, the applied set may differ
  1837. // depending on
  1838. // the Kubernetes version -- it's best to assume the behavior is
  1839. // undefined
  1840. // and conflicts should be avoided.
  1841. // For more information, including usage and the valid values,
  1842. // see:
  1843. // https://kubernetes.io/docs/concepts/overview/working-with-objects
  1844. // /labels/
  1845. Labels map[string]string `json:"labels,omitempty"`
  1846. // LocalSsdCount: The number of local SSD disks to be attached to the
  1847. // node.
  1848. //
  1849. // The limit for this value is dependant upon the maximum number
  1850. // of
  1851. // disks available on a machine per zone.
  1852. // See:
  1853. // https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_l
  1854. // imits
  1855. // for more information.
  1856. LocalSsdCount int64 `json:"localSsdCount,omitempty"`
  1857. // MachineType: The name of a Google Compute Engine
  1858. // [machine
  1859. // type](/compute/docs/machine-types) (e.g.
  1860. // `n1-standard-1`).
  1861. //
  1862. // If unspecified, the default machine type is
  1863. // `n1-standard-1`.
  1864. MachineType string `json:"machineType,omitempty"`
  1865. // Metadata: The metadata key/value pairs assigned to instances in the
  1866. // cluster.
  1867. //
  1868. // Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128
  1869. // bytes
  1870. // in length. These are reflected as part of a URL in the metadata
  1871. // server.
  1872. // Additionally, to avoid ambiguity, keys must not conflict with any
  1873. // other
  1874. // metadata keys for the project or be one of the reserved keys:
  1875. // "cluster-location"
  1876. // "cluster-name"
  1877. // "cluster-uid"
  1878. // "configure-sh"
  1879. // "containerd-configure-sh"
  1880. // "enable-os-login"
  1881. // "gci-update-strategy"
  1882. // "gci-ensure-gke-docker"
  1883. // "instance-template"
  1884. // "kube-env"
  1885. // "startup-script"
  1886. // "user-data"
  1887. //
  1888. // Values are free-form strings, and only have meaning as interpreted
  1889. // by
  1890. // the image running in the instance. The only restriction placed on
  1891. // them is
  1892. // that each value's size must be less than or equal to 32 KB.
  1893. //
  1894. // The total size of all keys and values must be less than 512 KB.
  1895. Metadata map[string]string `json:"metadata,omitempty"`
  1896. // MinCpuPlatform: Minimum CPU platform to be used by this instance. The
  1897. // instance may be
  1898. // scheduled on the specified or newer CPU platform. Applicable values
  1899. // are the
  1900. // friendly names of CPU platforms, such as
  1901. // <code>minCpuPlatform: &quot;Intel Haswell&quot;</code>
  1902. // or
  1903. // <code>minCpuPlatform: &quot;Intel Sandy Bridge&quot;</code>. For
  1904. // more
  1905. // information, read [how to specify min
  1906. // CPU
  1907. // platform](https://cloud.google.com/compute/docs/instances/specify-
  1908. // min-cpu-platform)
  1909. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  1910. // OauthScopes: The set of Google API scopes to be made available on all
  1911. // of the
  1912. // node VMs under the "default" service account.
  1913. //
  1914. // The following scopes are recommended, but not required, and by
  1915. // default are
  1916. // not included:
  1917. //
  1918. // * `https://www.googleapis.com/auth/compute` is required for
  1919. // mounting
  1920. // persistent storage on your nodes.
  1921. // * `https://www.googleapis.com/auth/devstorage.read_only` is required
  1922. // for
  1923. // communicating with **gcr.io**
  1924. // (the [Google Container Registry](/container-registry/)).
  1925. //
  1926. // If unspecified, no scopes are added, unless Cloud Logging or
  1927. // Cloud
  1928. // Monitoring are enabled, in which case their required scopes will be
  1929. // added.
  1930. OauthScopes []string `json:"oauthScopes,omitempty"`
  1931. // Preemptible: Whether the nodes are created as preemptible VM
  1932. // instances.
  1933. // See:
  1934. // https://cloud.google.com/compute/docs/instances/preemptible for
  1935. // more
  1936. // information about preemptible VM instances.
  1937. Preemptible bool `json:"preemptible,omitempty"`
  1938. // ServiceAccount: The Google Cloud Platform Service Account to be used
  1939. // by the node VMs. If
  1940. // no Service Account is specified, the "default" service account is
  1941. // used.
  1942. ServiceAccount string `json:"serviceAccount,omitempty"`
  1943. // Tags: The list of instance tags applied to all nodes. Tags are used
  1944. // to identify
  1945. // valid sources or targets for network firewalls and are specified
  1946. // by
  1947. // the client during cluster or node pool creation. Each tag within the
  1948. // list
  1949. // must comply with RFC1035.
  1950. Tags []string `json:"tags,omitempty"`
  1951. // Taints: List of kubernetes taints to be applied to each node.
  1952. //
  1953. // For more information, including usage and the valid values,
  1954. // see:
  1955. // https://kubernetes.io/docs/concepts/configuration/taint-and-toler
  1956. // ation/
  1957. Taints []*NodeTaint `json:"taints,omitempty"`
  1958. // ForceSendFields is a list of field names (e.g. "Accelerators") to
  1959. // unconditionally include in API requests. By default, fields with
  1960. // empty values are omitted from API requests. However, any non-pointer,
  1961. // non-interface field appearing in ForceSendFields will be sent to the
  1962. // server regardless of whether the field is empty or not. This may be
  1963. // used to include empty fields in Patch requests.
  1964. ForceSendFields []string `json:"-"`
  1965. // NullFields is a list of field names (e.g. "Accelerators") to include
  1966. // in API requests with the JSON null value. By default, fields with
  1967. // empty values are omitted from API requests. However, any field with
  1968. // an empty value appearing in NullFields will be sent to the server as
  1969. // null. It is an error if a field in this list has a non-empty value.
  1970. // This may be used to include null fields in Patch requests.
  1971. NullFields []string `json:"-"`
  1972. }
  1973. func (s *NodeConfig) MarshalJSON() ([]byte, error) {
  1974. type NoMethod NodeConfig
  1975. raw := NoMethod(*s)
  1976. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1977. }
  1978. // NodeManagement: NodeManagement defines the set of node management
  1979. // services turned on for the
  1980. // node pool.
  1981. type NodeManagement struct {
  1982. // AutoRepair: A flag that specifies whether the node auto-repair is
  1983. // enabled for the node
  1984. // pool. If enabled, the nodes in this node pool will be monitored and,
  1985. // if
  1986. // they fail health checks too many times, an automatic repair action
  1987. // will be
  1988. // triggered.
  1989. AutoRepair bool `json:"autoRepair,omitempty"`
  1990. // AutoUpgrade: A flag that specifies whether node auto-upgrade is
  1991. // enabled for the node
  1992. // pool. If enabled, node auto-upgrade helps keep the nodes in your node
  1993. // pool
  1994. // up to date with the latest release version of Kubernetes.
  1995. AutoUpgrade bool `json:"autoUpgrade,omitempty"`
  1996. // UpgradeOptions: Specifies the Auto Upgrade knobs for the node pool.
  1997. UpgradeOptions *AutoUpgradeOptions `json:"upgradeOptions,omitempty"`
  1998. // ForceSendFields is a list of field names (e.g. "AutoRepair") to
  1999. // unconditionally include in API requests. By default, fields with
  2000. // empty values are omitted from API requests. However, any non-pointer,
  2001. // non-interface field appearing in ForceSendFields will be sent to the
  2002. // server regardless of whether the field is empty or not. This may be
  2003. // used to include empty fields in Patch requests.
  2004. ForceSendFields []string `json:"-"`
  2005. // NullFields is a list of field names (e.g. "AutoRepair") to include in
  2006. // API requests with the JSON null value. By default, fields with empty
  2007. // values are omitted from API requests. However, any field with an
  2008. // empty value appearing in NullFields will be sent to the server as
  2009. // null. It is an error if a field in this list has a non-empty value.
  2010. // This may be used to include null fields in Patch requests.
  2011. NullFields []string `json:"-"`
  2012. }
  2013. func (s *NodeManagement) MarshalJSON() ([]byte, error) {
  2014. type NoMethod NodeManagement
  2015. raw := NoMethod(*s)
  2016. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2017. }
  2018. // NodePool: NodePool contains the name and configuration for a
  2019. // cluster's node pool.
  2020. // Node pools are a set of nodes (i.e. VM's), with a common
  2021. // configuration and
  2022. // specification, under the control of the cluster master. They may have
  2023. // a set
  2024. // of Kubernetes labels applied to them, which may be used to reference
  2025. // them
  2026. // during pod scheduling. They may also be resized up or down, to
  2027. // accommodate
  2028. // the workload.
  2029. type NodePool struct {
  2030. // Autoscaling: Autoscaler configuration for this NodePool. Autoscaler
  2031. // is enabled
  2032. // only if a valid configuration is present.
  2033. Autoscaling *NodePoolAutoscaling `json:"autoscaling,omitempty"`
  2034. // Conditions: Which conditions caused the current node pool state.
  2035. Conditions []*StatusCondition `json:"conditions,omitempty"`
  2036. // Config: The node configuration of the pool.
  2037. Config *NodeConfig `json:"config,omitempty"`
  2038. // InitialNodeCount: The initial node count for the pool. You must
  2039. // ensure that your
  2040. // Compute Engine <a href="/compute/docs/resource-quotas">resource
  2041. // quota</a>
  2042. // is sufficient for this number of instances. You must also have
  2043. // available
  2044. // firewall and routes quota.
  2045. InitialNodeCount int64 `json:"initialNodeCount,omitempty"`
  2046. // InstanceGroupUrls: [Output only] The resource URLs of the [managed
  2047. // instance
  2048. // groups](/compute/docs/instance-groups/creating-groups-of-mana
  2049. // ged-instances)
  2050. // associated with this node pool.
  2051. InstanceGroupUrls []string `json:"instanceGroupUrls,omitempty"`
  2052. // Management: NodeManagement configuration for this NodePool.
  2053. Management *NodeManagement `json:"management,omitempty"`
  2054. // MaxPodsConstraint: The constraint on the maximum number of pods that
  2055. // can be run
  2056. // simultaneously on a node in the node pool.
  2057. MaxPodsConstraint *MaxPodsConstraint `json:"maxPodsConstraint,omitempty"`
  2058. // Name: The name of the node pool.
  2059. Name string `json:"name,omitempty"`
  2060. // PodIpv4CidrSize: [Output only] The pod CIDR block size per node in
  2061. // this node pool.
  2062. PodIpv4CidrSize int64 `json:"podIpv4CidrSize,omitempty"`
  2063. // SelfLink: [Output only] Server-defined URL for the resource.
  2064. SelfLink string `json:"selfLink,omitempty"`
  2065. // Status: [Output only] The status of the nodes in this pool instance.
  2066. //
  2067. // Possible values:
  2068. // "STATUS_UNSPECIFIED" - Not set.
  2069. // "PROVISIONING" - The PROVISIONING state indicates the node pool is
  2070. // being created.
  2071. // "RUNNING" - The RUNNING state indicates the node pool has been
  2072. // created
  2073. // and is fully usable.
  2074. // "RUNNING_WITH_ERROR" - The RUNNING_WITH_ERROR state indicates the
  2075. // node pool has been created
  2076. // and is partially usable. Some error state has occurred and
  2077. // some
  2078. // functionality may be impaired. Customer may need to reissue a
  2079. // request
  2080. // or trigger a new update.
  2081. // "RECONCILING" - The RECONCILING state indicates that some work is
  2082. // actively being done on
  2083. // the node pool, such as upgrading node software. Details can
  2084. // be found in the `statusMessage` field.
  2085. // "STOPPING" - The STOPPING state indicates the node pool is being
  2086. // deleted.
  2087. // "ERROR" - The ERROR state indicates the node pool may be unusable.
  2088. // Details
  2089. // can be found in the `statusMessage` field.
  2090. Status string `json:"status,omitempty"`
  2091. // StatusMessage: [Output only] Additional information about the current
  2092. // status of this
  2093. // node pool instance, if available.
  2094. StatusMessage string `json:"statusMessage,omitempty"`
  2095. // Version: The version of the Kubernetes of this node.
  2096. Version string `json:"version,omitempty"`
  2097. // ServerResponse contains the HTTP response code and headers from the
  2098. // server.
  2099. googleapi.ServerResponse `json:"-"`
  2100. // ForceSendFields is a list of field names (e.g. "Autoscaling") to
  2101. // unconditionally include in API requests. By default, fields with
  2102. // empty values are omitted from API requests. However, any non-pointer,
  2103. // non-interface field appearing in ForceSendFields will be sent to the
  2104. // server regardless of whether the field is empty or not. This may be
  2105. // used to include empty fields in Patch requests.
  2106. ForceSendFields []string `json:"-"`
  2107. // NullFields is a list of field names (e.g. "Autoscaling") to include
  2108. // in API requests with the JSON null value. By default, fields with
  2109. // empty values are omitted from API requests. However, any field with
  2110. // an empty value appearing in NullFields will be sent to the server as
  2111. // null. It is an error if a field in this list has a non-empty value.
  2112. // This may be used to include null fields in Patch requests.
  2113. NullFields []string `json:"-"`
  2114. }
  2115. func (s *NodePool) MarshalJSON() ([]byte, error) {
  2116. type NoMethod NodePool
  2117. raw := NoMethod(*s)
  2118. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2119. }
  2120. // NodePoolAutoscaling: NodePoolAutoscaling contains information
  2121. // required by cluster autoscaler to
  2122. // adjust the size of the node pool to the current cluster usage.
  2123. type NodePoolAutoscaling struct {
  2124. // Enabled: Is autoscaling enabled for this node pool.
  2125. Enabled bool `json:"enabled,omitempty"`
  2126. // MaxNodeCount: Maximum number of nodes in the NodePool. Must be >=
  2127. // min_node_count. There
  2128. // has to enough quota to scale up the cluster.
  2129. MaxNodeCount int64 `json:"maxNodeCount,omitempty"`
  2130. // MinNodeCount: Minimum number of nodes in the NodePool. Must be >= 1
  2131. // and <=
  2132. // max_node_count.
  2133. MinNodeCount int64 `json:"minNodeCount,omitempty"`
  2134. // ForceSendFields is a list of field names (e.g. "Enabled") to
  2135. // unconditionally include in API requests. By default, fields with
  2136. // empty values are omitted from API requests. However, any non-pointer,
  2137. // non-interface field appearing in ForceSendFields will be sent to the
  2138. // server regardless of whether the field is empty or not. This may be
  2139. // used to include empty fields in Patch requests.
  2140. ForceSendFields []string `json:"-"`
  2141. // NullFields is a list of field names (e.g. "Enabled") to include in
  2142. // API requests with the JSON null value. By default, fields with empty
  2143. // values are omitted from API requests. However, any field with an
  2144. // empty value appearing in NullFields will be sent to the server as
  2145. // null. It is an error if a field in this list has a non-empty value.
  2146. // This may be used to include null fields in Patch requests.
  2147. NullFields []string `json:"-"`
  2148. }
  2149. func (s *NodePoolAutoscaling) MarshalJSON() ([]byte, error) {
  2150. type NoMethod NodePoolAutoscaling
  2151. raw := NoMethod(*s)
  2152. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2153. }
  2154. // NodeTaint: Kubernetes taint is comprised of three fields: key, value,
  2155. // and effect. Effect
  2156. // can only be one of three types: NoSchedule, PreferNoSchedule or
  2157. // NoExecute.
  2158. //
  2159. // For more information, including usage and the valid values,
  2160. // see:
  2161. // https://kubernetes.io/docs/concepts/configuration/taint-and-toler
  2162. // ation/
  2163. type NodeTaint struct {
  2164. // Effect: Effect for taint.
  2165. //
  2166. // Possible values:
  2167. // "EFFECT_UNSPECIFIED" - Not set
  2168. // "NO_SCHEDULE" - NoSchedule
  2169. // "PREFER_NO_SCHEDULE" - PreferNoSchedule
  2170. // "NO_EXECUTE" - NoExecute
  2171. Effect string `json:"effect,omitempty"`
  2172. // Key: Key for taint.
  2173. Key string `json:"key,omitempty"`
  2174. // Value: Value for taint.
  2175. Value string `json:"value,omitempty"`
  2176. // ForceSendFields is a list of field names (e.g. "Effect") to
  2177. // unconditionally include in API requests. By default, fields with
  2178. // empty values are omitted from API requests. However, any non-pointer,
  2179. // non-interface field appearing in ForceSendFields will be sent to the
  2180. // server regardless of whether the field is empty or not. This may be
  2181. // used to include empty fields in Patch requests.
  2182. ForceSendFields []string `json:"-"`
  2183. // NullFields is a list of field names (e.g. "Effect") to include in API
  2184. // requests with the JSON null value. By default, fields with empty
  2185. // values are omitted from API requests. However, any field with an
  2186. // empty value appearing in NullFields will be sent to the server as
  2187. // null. It is an error if a field in this list has a non-empty value.
  2188. // This may be used to include null fields in Patch requests.
  2189. NullFields []string `json:"-"`
  2190. }
  2191. func (s *NodeTaint) MarshalJSON() ([]byte, error) {
  2192. type NoMethod NodeTaint
  2193. raw := NoMethod(*s)
  2194. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2195. }
  2196. // Operation: This operation resource represents operations that may
  2197. // have happened or are
  2198. // happening on the cluster. All fields are output only.
  2199. type Operation struct {
  2200. // ClusterConditions: Which conditions caused the current cluster state.
  2201. ClusterConditions []*StatusCondition `json:"clusterConditions,omitempty"`
  2202. // Detail: Detailed operation progress, if available.
  2203. Detail string `json:"detail,omitempty"`
  2204. // EndTime: [Output only] The time the operation completed,
  2205. // in
  2206. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  2207. EndTime string `json:"endTime,omitempty"`
  2208. // Location: [Output only] The name of the Google Compute
  2209. // Engine
  2210. // [zone](/compute/docs/regions-zones/regions-zones#available)
  2211. // or
  2212. // [region](/compute/docs/regions-zones/regions-zones#available) in
  2213. // which
  2214. // the cluster resides.
  2215. Location string `json:"location,omitempty"`
  2216. // Name: The server-assigned ID for the operation.
  2217. Name string `json:"name,omitempty"`
  2218. // NodepoolConditions: Which conditions caused the current node pool
  2219. // state.
  2220. NodepoolConditions []*StatusCondition `json:"nodepoolConditions,omitempty"`
  2221. // OperationType: The operation type.
  2222. //
  2223. // Possible values:
  2224. // "TYPE_UNSPECIFIED" - Not set.
  2225. // "CREATE_CLUSTER" - Cluster create.
  2226. // "DELETE_CLUSTER" - Cluster delete.
  2227. // "UPGRADE_MASTER" - A master upgrade.
  2228. // "UPGRADE_NODES" - A node upgrade.
  2229. // "REPAIR_CLUSTER" - Cluster repair.
  2230. // "UPDATE_CLUSTER" - Cluster update.
  2231. // "CREATE_NODE_POOL" - Node pool create.
  2232. // "DELETE_NODE_POOL" - Node pool delete.
  2233. // "SET_NODE_POOL_MANAGEMENT" - Set node pool management.
  2234. // "AUTO_REPAIR_NODES" - Automatic node pool repair.
  2235. // "AUTO_UPGRADE_NODES" - Automatic node upgrade.
  2236. // "SET_LABELS" - Set labels.
  2237. // "SET_MASTER_AUTH" - Set/generate master auth materials
  2238. // "SET_NODE_POOL_SIZE" - Set node pool size.
  2239. // "SET_NETWORK_POLICY" - Updates network policy for a cluster.
  2240. // "SET_MAINTENANCE_POLICY" - Set the maintenance policy.
  2241. OperationType string `json:"operationType,omitempty"`
  2242. // SelfLink: Server-defined URL for the resource.
  2243. SelfLink string `json:"selfLink,omitempty"`
  2244. // StartTime: [Output only] The time the operation started,
  2245. // in
  2246. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  2247. StartTime string `json:"startTime,omitempty"`
  2248. // Status: The current status of the operation.
  2249. //
  2250. // Possible values:
  2251. // "STATUS_UNSPECIFIED" - Not set.
  2252. // "PENDING" - The operation has been created.
  2253. // "RUNNING" - The operation is currently running.
  2254. // "DONE" - The operation is done, either cancelled or completed.
  2255. // "ABORTING" - The operation is aborting.
  2256. Status string `json:"status,omitempty"`
  2257. // StatusMessage: If an error has occurred, a textual description of the
  2258. // error.
  2259. StatusMessage string `json:"statusMessage,omitempty"`
  2260. // TargetLink: Server-defined URL for the target of the operation.
  2261. TargetLink string `json:"targetLink,omitempty"`
  2262. // Zone: The name of the Google Compute
  2263. // Engine
  2264. // [zone](/compute/docs/zones#available) in which the operation
  2265. // is taking place.
  2266. // This field is deprecated, use location instead.
  2267. Zone string `json:"zone,omitempty"`
  2268. // ServerResponse contains the HTTP response code and headers from the
  2269. // server.
  2270. googleapi.ServerResponse `json:"-"`
  2271. // ForceSendFields is a list of field names (e.g. "ClusterConditions")
  2272. // to unconditionally include in API requests. By default, fields with
  2273. // empty values are omitted from API requests. However, any non-pointer,
  2274. // non-interface field appearing in ForceSendFields will be sent to the
  2275. // server regardless of whether the field is empty or not. This may be
  2276. // used to include empty fields in Patch requests.
  2277. ForceSendFields []string `json:"-"`
  2278. // NullFields is a list of field names (e.g. "ClusterConditions") to
  2279. // include in API requests with the JSON null value. By default, fields
  2280. // with empty values are omitted from API requests. However, any field
  2281. // with an empty value appearing in NullFields will be sent to the
  2282. // server as null. It is an error if a field in this list has a
  2283. // non-empty value. This may be used to include null fields in Patch
  2284. // requests.
  2285. NullFields []string `json:"-"`
  2286. }
  2287. func (s *Operation) MarshalJSON() ([]byte, error) {
  2288. type NoMethod Operation
  2289. raw := NoMethod(*s)
  2290. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2291. }
  2292. // PrivateClusterConfig: Configuration options for private clusters.
  2293. type PrivateClusterConfig struct {
  2294. // EnablePrivateEndpoint: Whether the master's internal IP address is
  2295. // used as the cluster endpoint.
  2296. EnablePrivateEndpoint bool `json:"enablePrivateEndpoint,omitempty"`
  2297. // EnablePrivateNodes: Whether nodes have internal IP addresses only. If
  2298. // enabled, all nodes are
  2299. // given only RFC 1918 private addresses and communicate with the master
  2300. // via
  2301. // private networking.
  2302. EnablePrivateNodes bool `json:"enablePrivateNodes,omitempty"`
  2303. // MasterIpv4CidrBlock: The IP range in CIDR notation to use for the
  2304. // hosted master network. This
  2305. // range will be used for assigning internal IP addresses to the master
  2306. // or
  2307. // set of masters, as well as the ILB VIP. This range must not overlap
  2308. // with
  2309. // any other ranges in use within the cluster's network.
  2310. MasterIpv4CidrBlock string `json:"masterIpv4CidrBlock,omitempty"`
  2311. // PrivateEndpoint: Output only. The internal IP address of this
  2312. // cluster's master endpoint.
  2313. PrivateEndpoint string `json:"privateEndpoint,omitempty"`
  2314. // PublicEndpoint: Output only. The external IP address of this
  2315. // cluster's master endpoint.
  2316. PublicEndpoint string `json:"publicEndpoint,omitempty"`
  2317. // ForceSendFields is a list of field names (e.g.
  2318. // "EnablePrivateEndpoint") to unconditionally include in API requests.
  2319. // By default, fields with empty values are omitted from API requests.
  2320. // However, any non-pointer, non-interface field appearing in
  2321. // ForceSendFields will be sent to the server regardless of whether the
  2322. // field is empty or not. This may be used to include empty fields in
  2323. // Patch requests.
  2324. ForceSendFields []string `json:"-"`
  2325. // NullFields is a list of field names (e.g. "EnablePrivateEndpoint") to
  2326. // include in API requests with the JSON null value. By default, fields
  2327. // with empty values are omitted from API requests. However, any field
  2328. // with an empty value appearing in NullFields will be sent to the
  2329. // server as null. It is an error if a field in this list has a
  2330. // non-empty value. This may be used to include null fields in Patch
  2331. // requests.
  2332. NullFields []string `json:"-"`
  2333. }
  2334. func (s *PrivateClusterConfig) MarshalJSON() ([]byte, error) {
  2335. type NoMethod PrivateClusterConfig
  2336. raw := NoMethod(*s)
  2337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2338. }
  2339. // RollbackNodePoolUpgradeRequest: RollbackNodePoolUpgradeRequest
  2340. // rollbacks the previously Aborted or Failed
  2341. // NodePool upgrade. This will be an no-op if the last upgrade
  2342. // successfully
  2343. // completed.
  2344. type RollbackNodePoolUpgradeRequest struct {
  2345. // ClusterId: Deprecated. The name of the cluster to rollback.
  2346. // This field has been deprecated and replaced by the name field.
  2347. ClusterId string `json:"clusterId,omitempty"`
  2348. // Name: The name (project, location, cluster, node pool id) of the node
  2349. // poll to
  2350. // rollback upgrade.
  2351. // Specified in the format
  2352. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2353. Name string `json:"name,omitempty"`
  2354. // NodePoolId: Deprecated. The name of the node pool to rollback.
  2355. // This field has been deprecated and replaced by the name field.
  2356. NodePoolId string `json:"nodePoolId,omitempty"`
  2357. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2358. // project
  2359. // number](https://support.google.com/cloud/answer/6158840).
  2360. // This
  2361. // field has been deprecated and replaced by the name field.
  2362. ProjectId string `json:"projectId,omitempty"`
  2363. // Zone: Deprecated. The name of the Google Compute
  2364. // Engine
  2365. // [zone](/compute/docs/zones#available) in which the
  2366. // cluster
  2367. // resides.
  2368. // This field has been deprecated and replaced by the name field.
  2369. Zone string `json:"zone,omitempty"`
  2370. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2371. // unconditionally include in API requests. By default, fields with
  2372. // empty values are omitted from API requests. However, any non-pointer,
  2373. // non-interface field appearing in ForceSendFields will be sent to the
  2374. // server regardless of whether the field is empty or not. This may be
  2375. // used to include empty fields in Patch requests.
  2376. ForceSendFields []string `json:"-"`
  2377. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2378. // API requests with the JSON null value. By default, fields with empty
  2379. // values are omitted from API requests. However, any field with an
  2380. // empty value appearing in NullFields will be sent to the server as
  2381. // null. It is an error if a field in this list has a non-empty value.
  2382. // This may be used to include null fields in Patch requests.
  2383. NullFields []string `json:"-"`
  2384. }
  2385. func (s *RollbackNodePoolUpgradeRequest) MarshalJSON() ([]byte, error) {
  2386. type NoMethod RollbackNodePoolUpgradeRequest
  2387. raw := NoMethod(*s)
  2388. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2389. }
  2390. // ServerConfig: Kubernetes Engine service configuration.
  2391. type ServerConfig struct {
  2392. // DefaultClusterVersion: Version of Kubernetes the service deploys by
  2393. // default.
  2394. DefaultClusterVersion string `json:"defaultClusterVersion,omitempty"`
  2395. // DefaultImageType: Default image type.
  2396. DefaultImageType string `json:"defaultImageType,omitempty"`
  2397. // ValidImageTypes: List of valid image types.
  2398. ValidImageTypes []string `json:"validImageTypes,omitempty"`
  2399. // ValidMasterVersions: List of valid master versions.
  2400. ValidMasterVersions []string `json:"validMasterVersions,omitempty"`
  2401. // ValidNodeVersions: List of valid node upgrade target versions.
  2402. ValidNodeVersions []string `json:"validNodeVersions,omitempty"`
  2403. // ServerResponse contains the HTTP response code and headers from the
  2404. // server.
  2405. googleapi.ServerResponse `json:"-"`
  2406. // ForceSendFields is a list of field names (e.g.
  2407. // "DefaultClusterVersion") to unconditionally include in API requests.
  2408. // By default, fields with empty values are omitted from API requests.
  2409. // However, any non-pointer, non-interface field appearing in
  2410. // ForceSendFields will be sent to the server regardless of whether the
  2411. // field is empty or not. This may be used to include empty fields in
  2412. // Patch requests.
  2413. ForceSendFields []string `json:"-"`
  2414. // NullFields is a list of field names (e.g. "DefaultClusterVersion") to
  2415. // include in API requests with the JSON null value. By default, fields
  2416. // with empty values are omitted from API requests. However, any field
  2417. // with an empty value appearing in NullFields will be sent to the
  2418. // server as null. It is an error if a field in this list has a
  2419. // non-empty value. This may be used to include null fields in Patch
  2420. // requests.
  2421. NullFields []string `json:"-"`
  2422. }
  2423. func (s *ServerConfig) MarshalJSON() ([]byte, error) {
  2424. type NoMethod ServerConfig
  2425. raw := NoMethod(*s)
  2426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2427. }
  2428. // SetAddonsConfigRequest: SetAddonsConfigRequest sets the addons
  2429. // associated with the cluster.
  2430. type SetAddonsConfigRequest struct {
  2431. // AddonsConfig: The desired configurations for the various addons
  2432. // available to run in the
  2433. // cluster.
  2434. AddonsConfig *AddonsConfig `json:"addonsConfig,omitempty"`
  2435. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2436. // This field has been deprecated and replaced by the name field.
  2437. ClusterId string `json:"clusterId,omitempty"`
  2438. // Name: The name (project, location, cluster) of the cluster to set
  2439. // addons.
  2440. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2441. Name string `json:"name,omitempty"`
  2442. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2443. // project
  2444. // number](https://support.google.com/cloud/answer/6158840).
  2445. // This
  2446. // field has been deprecated and replaced by the name field.
  2447. ProjectId string `json:"projectId,omitempty"`
  2448. // Zone: Deprecated. The name of the Google Compute
  2449. // Engine
  2450. // [zone](/compute/docs/zones#available) in which the
  2451. // cluster
  2452. // resides.
  2453. // This field has been deprecated and replaced by the name field.
  2454. Zone string `json:"zone,omitempty"`
  2455. // ForceSendFields is a list of field names (e.g. "AddonsConfig") to
  2456. // unconditionally include in API requests. By default, fields with
  2457. // empty values are omitted from API requests. However, any non-pointer,
  2458. // non-interface field appearing in ForceSendFields will be sent to the
  2459. // server regardless of whether the field is empty or not. This may be
  2460. // used to include empty fields in Patch requests.
  2461. ForceSendFields []string `json:"-"`
  2462. // NullFields is a list of field names (e.g. "AddonsConfig") to include
  2463. // in API requests with the JSON null value. By default, fields with
  2464. // empty values are omitted from API requests. However, any field with
  2465. // an empty value appearing in NullFields will be sent to the server as
  2466. // null. It is an error if a field in this list has a non-empty value.
  2467. // This may be used to include null fields in Patch requests.
  2468. NullFields []string `json:"-"`
  2469. }
  2470. func (s *SetAddonsConfigRequest) MarshalJSON() ([]byte, error) {
  2471. type NoMethod SetAddonsConfigRequest
  2472. raw := NoMethod(*s)
  2473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2474. }
  2475. // SetLabelsRequest: SetLabelsRequest sets the Google Cloud Platform
  2476. // labels on a Google Container
  2477. // Engine cluster, which will in turn set them for Google Compute
  2478. // Engine
  2479. // resources used by that cluster
  2480. type SetLabelsRequest struct {
  2481. // ClusterId: Deprecated. The name of the cluster.
  2482. // This field has been deprecated and replaced by the name field.
  2483. ClusterId string `json:"clusterId,omitempty"`
  2484. // LabelFingerprint: The fingerprint of the previous set of labels for
  2485. // this resource,
  2486. // used to detect conflicts. The fingerprint is initially generated
  2487. // by
  2488. // Kubernetes Engine and changes after every request to modify or
  2489. // update
  2490. // labels. You must always provide an up-to-date fingerprint hash
  2491. // when
  2492. // updating or changing labels. Make a <code>get()</code> request to
  2493. // the
  2494. // resource to get the latest fingerprint.
  2495. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  2496. // Name: The name (project, location, cluster id) of the cluster to set
  2497. // labels.
  2498. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2499. Name string `json:"name,omitempty"`
  2500. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2501. // project
  2502. // number](https://developers.google.com/console/help/new/#projec
  2503. // tnumber).
  2504. // This field has been deprecated and replaced by the name field.
  2505. ProjectId string `json:"projectId,omitempty"`
  2506. // ResourceLabels: The labels to set for that cluster.
  2507. ResourceLabels map[string]string `json:"resourceLabels,omitempty"`
  2508. // Zone: Deprecated. The name of the Google Compute
  2509. // Engine
  2510. // [zone](/compute/docs/zones#available) in which the
  2511. // cluster
  2512. // resides.
  2513. // This field has been deprecated and replaced by the name field.
  2514. Zone string `json:"zone,omitempty"`
  2515. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2516. // unconditionally include in API requests. By default, fields with
  2517. // empty values are omitted from API requests. However, any non-pointer,
  2518. // non-interface field appearing in ForceSendFields will be sent to the
  2519. // server regardless of whether the field is empty or not. This may be
  2520. // used to include empty fields in Patch requests.
  2521. ForceSendFields []string `json:"-"`
  2522. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2523. // API requests with the JSON null value. By default, fields with empty
  2524. // values are omitted from API requests. However, any field with an
  2525. // empty value appearing in NullFields will be sent to the server as
  2526. // null. It is an error if a field in this list has a non-empty value.
  2527. // This may be used to include null fields in Patch requests.
  2528. NullFields []string `json:"-"`
  2529. }
  2530. func (s *SetLabelsRequest) MarshalJSON() ([]byte, error) {
  2531. type NoMethod SetLabelsRequest
  2532. raw := NoMethod(*s)
  2533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2534. }
  2535. // SetLegacyAbacRequest: SetLegacyAbacRequest enables or disables the
  2536. // ABAC authorization mechanism for
  2537. // a cluster.
  2538. type SetLegacyAbacRequest struct {
  2539. // ClusterId: Deprecated. The name of the cluster to update.
  2540. // This field has been deprecated and replaced by the name field.
  2541. ClusterId string `json:"clusterId,omitempty"`
  2542. // Enabled: Whether ABAC authorization will be enabled in the cluster.
  2543. Enabled bool `json:"enabled,omitempty"`
  2544. // Name: The name (project, location, cluster id) of the cluster to set
  2545. // legacy abac.
  2546. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2547. Name string `json:"name,omitempty"`
  2548. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2549. // project
  2550. // number](https://support.google.com/cloud/answer/6158840).
  2551. // This
  2552. // field has been deprecated and replaced by the name field.
  2553. ProjectId string `json:"projectId,omitempty"`
  2554. // Zone: Deprecated. The name of the Google Compute
  2555. // Engine
  2556. // [zone](/compute/docs/zones#available) in which the
  2557. // cluster
  2558. // resides.
  2559. // This field has been deprecated and replaced by the name field.
  2560. Zone string `json:"zone,omitempty"`
  2561. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2562. // unconditionally include in API requests. By default, fields with
  2563. // empty values are omitted from API requests. However, any non-pointer,
  2564. // non-interface field appearing in ForceSendFields will be sent to the
  2565. // server regardless of whether the field is empty or not. This may be
  2566. // used to include empty fields in Patch requests.
  2567. ForceSendFields []string `json:"-"`
  2568. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2569. // API requests with the JSON null value. By default, fields with empty
  2570. // values are omitted from API requests. However, any field with an
  2571. // empty value appearing in NullFields will be sent to the server as
  2572. // null. It is an error if a field in this list has a non-empty value.
  2573. // This may be used to include null fields in Patch requests.
  2574. NullFields []string `json:"-"`
  2575. }
  2576. func (s *SetLegacyAbacRequest) MarshalJSON() ([]byte, error) {
  2577. type NoMethod SetLegacyAbacRequest
  2578. raw := NoMethod(*s)
  2579. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2580. }
  2581. // SetLocationsRequest: SetLocationsRequest sets the locations of the
  2582. // cluster.
  2583. type SetLocationsRequest struct {
  2584. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2585. // This field has been deprecated and replaced by the name field.
  2586. ClusterId string `json:"clusterId,omitempty"`
  2587. // Locations: The desired list of Google Compute
  2588. // Engine
  2589. // [zones](/compute/docs/zones#available) in which the cluster's
  2590. // nodes
  2591. // should be located. Changing the locations a cluster is in will
  2592. // result
  2593. // in nodes being either created or removed from the cluster, depending
  2594. // on
  2595. // whether locations are being added or removed.
  2596. //
  2597. // This list must always include the cluster's primary zone.
  2598. Locations []string `json:"locations,omitempty"`
  2599. // Name: The name (project, location, cluster) of the cluster to set
  2600. // locations.
  2601. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2602. Name string `json:"name,omitempty"`
  2603. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2604. // project
  2605. // number](https://support.google.com/cloud/answer/6158840).
  2606. // This
  2607. // field has been deprecated and replaced by the name field.
  2608. ProjectId string `json:"projectId,omitempty"`
  2609. // Zone: Deprecated. The name of the Google Compute
  2610. // Engine
  2611. // [zone](/compute/docs/zones#available) in which the
  2612. // cluster
  2613. // resides.
  2614. // This field has been deprecated and replaced by the name field.
  2615. Zone string `json:"zone,omitempty"`
  2616. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2617. // unconditionally include in API requests. By default, fields with
  2618. // empty values are omitted from API requests. However, any non-pointer,
  2619. // non-interface field appearing in ForceSendFields will be sent to the
  2620. // server regardless of whether the field is empty or not. This may be
  2621. // used to include empty fields in Patch requests.
  2622. ForceSendFields []string `json:"-"`
  2623. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2624. // API requests with the JSON null value. By default, fields with empty
  2625. // values are omitted from API requests. However, any field with an
  2626. // empty value appearing in NullFields will be sent to the server as
  2627. // null. It is an error if a field in this list has a non-empty value.
  2628. // This may be used to include null fields in Patch requests.
  2629. NullFields []string `json:"-"`
  2630. }
  2631. func (s *SetLocationsRequest) MarshalJSON() ([]byte, error) {
  2632. type NoMethod SetLocationsRequest
  2633. raw := NoMethod(*s)
  2634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2635. }
  2636. // SetLoggingServiceRequest: SetLoggingServiceRequest sets the logging
  2637. // service of a cluster.
  2638. type SetLoggingServiceRequest struct {
  2639. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2640. // This field has been deprecated and replaced by the name field.
  2641. ClusterId string `json:"clusterId,omitempty"`
  2642. // LoggingService: The logging service the cluster should use to write
  2643. // metrics.
  2644. // Currently available options:
  2645. //
  2646. // * "logging.googleapis.com" - the Google Cloud Logging service
  2647. // * "none" - no metrics will be exported from the cluster
  2648. LoggingService string `json:"loggingService,omitempty"`
  2649. // Name: The name (project, location, cluster) of the cluster to set
  2650. // logging.
  2651. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2652. Name string `json:"name,omitempty"`
  2653. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2654. // project
  2655. // number](https://support.google.com/cloud/answer/6158840).
  2656. // This
  2657. // field has been deprecated and replaced by the name field.
  2658. ProjectId string `json:"projectId,omitempty"`
  2659. // Zone: Deprecated. The name of the Google Compute
  2660. // Engine
  2661. // [zone](/compute/docs/zones#available) in which the
  2662. // cluster
  2663. // resides.
  2664. // This field has been deprecated and replaced by the name field.
  2665. Zone string `json:"zone,omitempty"`
  2666. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2667. // unconditionally include in API requests. By default, fields with
  2668. // empty values are omitted from API requests. However, any non-pointer,
  2669. // non-interface field appearing in ForceSendFields will be sent to the
  2670. // server regardless of whether the field is empty or not. This may be
  2671. // used to include empty fields in Patch requests.
  2672. ForceSendFields []string `json:"-"`
  2673. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2674. // API requests with the JSON null value. By default, fields with empty
  2675. // values are omitted from API requests. However, any field with an
  2676. // empty value appearing in NullFields will be sent to the server as
  2677. // null. It is an error if a field in this list has a non-empty value.
  2678. // This may be used to include null fields in Patch requests.
  2679. NullFields []string `json:"-"`
  2680. }
  2681. func (s *SetLoggingServiceRequest) MarshalJSON() ([]byte, error) {
  2682. type NoMethod SetLoggingServiceRequest
  2683. raw := NoMethod(*s)
  2684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2685. }
  2686. // SetMaintenancePolicyRequest: SetMaintenancePolicyRequest sets the
  2687. // maintenance policy for a cluster.
  2688. type SetMaintenancePolicyRequest struct {
  2689. // ClusterId: The name of the cluster to update.
  2690. ClusterId string `json:"clusterId,omitempty"`
  2691. // MaintenancePolicy: The maintenance policy to be set for the cluster.
  2692. // An empty field
  2693. // clears the existing maintenance policy.
  2694. MaintenancePolicy *MaintenancePolicy `json:"maintenancePolicy,omitempty"`
  2695. // Name: The name (project, location, cluster id) of the cluster to set
  2696. // maintenance
  2697. // policy.
  2698. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2699. Name string `json:"name,omitempty"`
  2700. // ProjectId: The Google Developers Console [project ID or
  2701. // project
  2702. // number](https://support.google.com/cloud/answer/6158840).
  2703. ProjectId string `json:"projectId,omitempty"`
  2704. // Zone: The name of the Google Compute
  2705. // Engine
  2706. // [zone](/compute/docs/zones#available) in which the cluster
  2707. // resides.
  2708. Zone string `json:"zone,omitempty"`
  2709. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2710. // unconditionally include in API requests. By default, fields with
  2711. // empty values are omitted from API requests. However, any non-pointer,
  2712. // non-interface field appearing in ForceSendFields will be sent to the
  2713. // server regardless of whether the field is empty or not. This may be
  2714. // used to include empty fields in Patch requests.
  2715. ForceSendFields []string `json:"-"`
  2716. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2717. // API requests with the JSON null value. By default, fields with empty
  2718. // values are omitted from API requests. However, any field with an
  2719. // empty value appearing in NullFields will be sent to the server as
  2720. // null. It is an error if a field in this list has a non-empty value.
  2721. // This may be used to include null fields in Patch requests.
  2722. NullFields []string `json:"-"`
  2723. }
  2724. func (s *SetMaintenancePolicyRequest) MarshalJSON() ([]byte, error) {
  2725. type NoMethod SetMaintenancePolicyRequest
  2726. raw := NoMethod(*s)
  2727. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2728. }
  2729. // SetMasterAuthRequest: SetMasterAuthRequest updates the admin password
  2730. // of a cluster.
  2731. type SetMasterAuthRequest struct {
  2732. // Action: The exact form of action to be taken on the master auth.
  2733. //
  2734. // Possible values:
  2735. // "UNKNOWN" - Operation is unknown and will error out.
  2736. // "SET_PASSWORD" - Set the password to a user generated value.
  2737. // "GENERATE_PASSWORD" - Generate a new password and set it to that.
  2738. // "SET_USERNAME" - Set the username. If an empty username is
  2739. // provided, basic authentication
  2740. // is disabled for the cluster. If a non-empty username is provided,
  2741. // basic
  2742. // authentication is enabled, with either a provided password or a
  2743. // generated
  2744. // one.
  2745. Action string `json:"action,omitempty"`
  2746. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2747. // This field has been deprecated and replaced by the name field.
  2748. ClusterId string `json:"clusterId,omitempty"`
  2749. // Name: The name (project, location, cluster) of the cluster to set
  2750. // auth.
  2751. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2752. Name string `json:"name,omitempty"`
  2753. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2754. // project
  2755. // number](https://support.google.com/cloud/answer/6158840).
  2756. // This
  2757. // field has been deprecated and replaced by the name field.
  2758. ProjectId string `json:"projectId,omitempty"`
  2759. // Update: A description of the update.
  2760. Update *MasterAuth `json:"update,omitempty"`
  2761. // Zone: Deprecated. The name of the Google Compute
  2762. // Engine
  2763. // [zone](/compute/docs/zones#available) in which the
  2764. // cluster
  2765. // resides.
  2766. // This field has been deprecated and replaced by the name field.
  2767. Zone string `json:"zone,omitempty"`
  2768. // ForceSendFields is a list of field names (e.g. "Action") to
  2769. // unconditionally include in API requests. By default, fields with
  2770. // empty values are omitted from API requests. However, any non-pointer,
  2771. // non-interface field appearing in ForceSendFields will be sent to the
  2772. // server regardless of whether the field is empty or not. This may be
  2773. // used to include empty fields in Patch requests.
  2774. ForceSendFields []string `json:"-"`
  2775. // NullFields is a list of field names (e.g. "Action") to include in API
  2776. // requests with the JSON null value. By default, fields with empty
  2777. // values are omitted from API requests. However, any field with an
  2778. // empty value appearing in NullFields will be sent to the server as
  2779. // null. It is an error if a field in this list has a non-empty value.
  2780. // This may be used to include null fields in Patch requests.
  2781. NullFields []string `json:"-"`
  2782. }
  2783. func (s *SetMasterAuthRequest) MarshalJSON() ([]byte, error) {
  2784. type NoMethod SetMasterAuthRequest
  2785. raw := NoMethod(*s)
  2786. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2787. }
  2788. // SetMonitoringServiceRequest: SetMonitoringServiceRequest sets the
  2789. // monitoring service of a cluster.
  2790. type SetMonitoringServiceRequest struct {
  2791. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2792. // This field has been deprecated and replaced by the name field.
  2793. ClusterId string `json:"clusterId,omitempty"`
  2794. // MonitoringService: The monitoring service the cluster should use to
  2795. // write metrics.
  2796. // Currently available options:
  2797. //
  2798. // * "monitoring.googleapis.com" - the Google Cloud Monitoring service
  2799. // * "none" - no metrics will be exported from the cluster
  2800. MonitoringService string `json:"monitoringService,omitempty"`
  2801. // Name: The name (project, location, cluster) of the cluster to set
  2802. // monitoring.
  2803. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2804. Name string `json:"name,omitempty"`
  2805. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2806. // project
  2807. // number](https://support.google.com/cloud/answer/6158840).
  2808. // This
  2809. // field has been deprecated and replaced by the name field.
  2810. ProjectId string `json:"projectId,omitempty"`
  2811. // Zone: Deprecated. The name of the Google Compute
  2812. // Engine
  2813. // [zone](/compute/docs/zones#available) in which the
  2814. // cluster
  2815. // resides.
  2816. // This field has been deprecated and replaced by the name field.
  2817. Zone string `json:"zone,omitempty"`
  2818. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2819. // unconditionally include in API requests. By default, fields with
  2820. // empty values are omitted from API requests. However, any non-pointer,
  2821. // non-interface field appearing in ForceSendFields will be sent to the
  2822. // server regardless of whether the field is empty or not. This may be
  2823. // used to include empty fields in Patch requests.
  2824. ForceSendFields []string `json:"-"`
  2825. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2826. // API requests with the JSON null value. By default, fields with empty
  2827. // values are omitted from API requests. However, any field with an
  2828. // empty value appearing in NullFields will be sent to the server as
  2829. // null. It is an error if a field in this list has a non-empty value.
  2830. // This may be used to include null fields in Patch requests.
  2831. NullFields []string `json:"-"`
  2832. }
  2833. func (s *SetMonitoringServiceRequest) MarshalJSON() ([]byte, error) {
  2834. type NoMethod SetMonitoringServiceRequest
  2835. raw := NoMethod(*s)
  2836. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2837. }
  2838. // SetNetworkPolicyRequest: SetNetworkPolicyRequest enables/disables
  2839. // network policy for a cluster.
  2840. type SetNetworkPolicyRequest struct {
  2841. // ClusterId: Deprecated. The name of the cluster.
  2842. // This field has been deprecated and replaced by the name field.
  2843. ClusterId string `json:"clusterId,omitempty"`
  2844. // Name: The name (project, location, cluster id) of the cluster to set
  2845. // networking
  2846. // policy. Specified in the format 'projects/*/locations/*/clusters/*'.
  2847. Name string `json:"name,omitempty"`
  2848. // NetworkPolicy: Configuration options for the NetworkPolicy feature.
  2849. NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"`
  2850. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2851. // project
  2852. // number](https://developers.google.com/console/help/new/#projec
  2853. // tnumber).
  2854. // This field has been deprecated and replaced by the name field.
  2855. ProjectId string `json:"projectId,omitempty"`
  2856. // Zone: Deprecated. The name of the Google Compute
  2857. // Engine
  2858. // [zone](/compute/docs/zones#available) in which the
  2859. // cluster
  2860. // resides.
  2861. // This field has been deprecated and replaced by the name field.
  2862. Zone string `json:"zone,omitempty"`
  2863. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2864. // unconditionally include in API requests. By default, fields with
  2865. // empty values are omitted from API requests. However, any non-pointer,
  2866. // non-interface field appearing in ForceSendFields will be sent to the
  2867. // server regardless of whether the field is empty or not. This may be
  2868. // used to include empty fields in Patch requests.
  2869. ForceSendFields []string `json:"-"`
  2870. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2871. // API requests with the JSON null value. By default, fields with empty
  2872. // values are omitted from API requests. However, any field with an
  2873. // empty value appearing in NullFields will be sent to the server as
  2874. // null. It is an error if a field in this list has a non-empty value.
  2875. // This may be used to include null fields in Patch requests.
  2876. NullFields []string `json:"-"`
  2877. }
  2878. func (s *SetNetworkPolicyRequest) MarshalJSON() ([]byte, error) {
  2879. type NoMethod SetNetworkPolicyRequest
  2880. raw := NoMethod(*s)
  2881. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2882. }
  2883. // SetNodePoolAutoscalingRequest: SetNodePoolAutoscalingRequest sets the
  2884. // autoscaler settings of a node pool.
  2885. type SetNodePoolAutoscalingRequest struct {
  2886. // Autoscaling: Autoscaling configuration for the node pool.
  2887. Autoscaling *NodePoolAutoscaling `json:"autoscaling,omitempty"`
  2888. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2889. // This field has been deprecated and replaced by the name field.
  2890. ClusterId string `json:"clusterId,omitempty"`
  2891. // Name: The name (project, location, cluster, node pool) of the node
  2892. // pool to set
  2893. // autoscaler settings. Specified in the
  2894. // format
  2895. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2896. Name string `json:"name,omitempty"`
  2897. // NodePoolId: Deprecated. The name of the node pool to upgrade.
  2898. // This field has been deprecated and replaced by the name field.
  2899. NodePoolId string `json:"nodePoolId,omitempty"`
  2900. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2901. // project
  2902. // number](https://support.google.com/cloud/answer/6158840).
  2903. // This
  2904. // field has been deprecated and replaced by the name field.
  2905. ProjectId string `json:"projectId,omitempty"`
  2906. // Zone: Deprecated. The name of the Google Compute
  2907. // Engine
  2908. // [zone](/compute/docs/zones#available) in which the
  2909. // cluster
  2910. // resides.
  2911. // This field has been deprecated and replaced by the name field.
  2912. Zone string `json:"zone,omitempty"`
  2913. // ForceSendFields is a list of field names (e.g. "Autoscaling") to
  2914. // unconditionally include in API requests. By default, fields with
  2915. // empty values are omitted from API requests. However, any non-pointer,
  2916. // non-interface field appearing in ForceSendFields will be sent to the
  2917. // server regardless of whether the field is empty or not. This may be
  2918. // used to include empty fields in Patch requests.
  2919. ForceSendFields []string `json:"-"`
  2920. // NullFields is a list of field names (e.g. "Autoscaling") to include
  2921. // in API requests with the JSON null value. By default, fields with
  2922. // empty values are omitted from API requests. However, any field with
  2923. // an empty value appearing in NullFields will be sent to the server as
  2924. // null. It is an error if a field in this list has a non-empty value.
  2925. // This may be used to include null fields in Patch requests.
  2926. NullFields []string `json:"-"`
  2927. }
  2928. func (s *SetNodePoolAutoscalingRequest) MarshalJSON() ([]byte, error) {
  2929. type NoMethod SetNodePoolAutoscalingRequest
  2930. raw := NoMethod(*s)
  2931. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2932. }
  2933. // SetNodePoolManagementRequest: SetNodePoolManagementRequest sets the
  2934. // node management properties of a node
  2935. // pool.
  2936. type SetNodePoolManagementRequest struct {
  2937. // ClusterId: Deprecated. The name of the cluster to update.
  2938. // This field has been deprecated and replaced by the name field.
  2939. ClusterId string `json:"clusterId,omitempty"`
  2940. // Management: NodeManagement configuration for the node pool.
  2941. Management *NodeManagement `json:"management,omitempty"`
  2942. // Name: The name (project, location, cluster, node pool id) of the node
  2943. // pool to set
  2944. // management properties. Specified in the
  2945. // format
  2946. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2947. Name string `json:"name,omitempty"`
  2948. // NodePoolId: Deprecated. The name of the node pool to update.
  2949. // This field has been deprecated and replaced by the name field.
  2950. NodePoolId string `json:"nodePoolId,omitempty"`
  2951. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2952. // project
  2953. // number](https://support.google.com/cloud/answer/6158840).
  2954. // This
  2955. // field has been deprecated and replaced by the name field.
  2956. ProjectId string `json:"projectId,omitempty"`
  2957. // Zone: Deprecated. The name of the Google Compute
  2958. // Engine
  2959. // [zone](/compute/docs/zones#available) in which the
  2960. // cluster
  2961. // resides.
  2962. // This field has been deprecated and replaced by the name field.
  2963. Zone string `json:"zone,omitempty"`
  2964. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2965. // unconditionally include in API requests. By default, fields with
  2966. // empty values are omitted from API requests. However, any non-pointer,
  2967. // non-interface field appearing in ForceSendFields will be sent to the
  2968. // server regardless of whether the field is empty or not. This may be
  2969. // used to include empty fields in Patch requests.
  2970. ForceSendFields []string `json:"-"`
  2971. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2972. // API requests with the JSON null value. By default, fields with empty
  2973. // values are omitted from API requests. However, any field with an
  2974. // empty value appearing in NullFields will be sent to the server as
  2975. // null. It is an error if a field in this list has a non-empty value.
  2976. // This may be used to include null fields in Patch requests.
  2977. NullFields []string `json:"-"`
  2978. }
  2979. func (s *SetNodePoolManagementRequest) MarshalJSON() ([]byte, error) {
  2980. type NoMethod SetNodePoolManagementRequest
  2981. raw := NoMethod(*s)
  2982. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2983. }
  2984. // SetNodePoolSizeRequest: SetNodePoolSizeRequest sets the size a
  2985. // node
  2986. // pool.
  2987. type SetNodePoolSizeRequest struct {
  2988. // ClusterId: Deprecated. The name of the cluster to update.
  2989. // This field has been deprecated and replaced by the name field.
  2990. ClusterId string `json:"clusterId,omitempty"`
  2991. // Name: The name (project, location, cluster, node pool id) of the node
  2992. // pool to set
  2993. // size.
  2994. // Specified in the format
  2995. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2996. Name string `json:"name,omitempty"`
  2997. // NodeCount: The desired node count for the pool.
  2998. NodeCount int64 `json:"nodeCount,omitempty"`
  2999. // NodePoolId: Deprecated. The name of the node pool to update.
  3000. // This field has been deprecated and replaced by the name field.
  3001. NodePoolId string `json:"nodePoolId,omitempty"`
  3002. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3003. // project
  3004. // number](https://support.google.com/cloud/answer/6158840).
  3005. // This
  3006. // field has been deprecated and replaced by the name field.
  3007. ProjectId string `json:"projectId,omitempty"`
  3008. // Zone: Deprecated. The name of the Google Compute
  3009. // Engine
  3010. // [zone](/compute/docs/zones#available) in which the
  3011. // cluster
  3012. // resides.
  3013. // This field has been deprecated and replaced by the name field.
  3014. Zone string `json:"zone,omitempty"`
  3015. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3016. // unconditionally include in API requests. By default, fields with
  3017. // empty values are omitted from API requests. However, any non-pointer,
  3018. // non-interface field appearing in ForceSendFields will be sent to the
  3019. // server regardless of whether the field is empty or not. This may be
  3020. // used to include empty fields in Patch requests.
  3021. ForceSendFields []string `json:"-"`
  3022. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3023. // API requests with the JSON null value. By default, fields with empty
  3024. // values are omitted from API requests. However, any field with an
  3025. // empty value appearing in NullFields will be sent to the server as
  3026. // null. It is an error if a field in this list has a non-empty value.
  3027. // This may be used to include null fields in Patch requests.
  3028. NullFields []string `json:"-"`
  3029. }
  3030. func (s *SetNodePoolSizeRequest) MarshalJSON() ([]byte, error) {
  3031. type NoMethod SetNodePoolSizeRequest
  3032. raw := NoMethod(*s)
  3033. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3034. }
  3035. // StartIPRotationRequest: StartIPRotationRequest creates a new IP for
  3036. // the cluster and then performs
  3037. // a node upgrade on each node pool to point to the new IP.
  3038. type StartIPRotationRequest struct {
  3039. // ClusterId: Deprecated. The name of the cluster.
  3040. // This field has been deprecated and replaced by the name field.
  3041. ClusterId string `json:"clusterId,omitempty"`
  3042. // Name: The name (project, location, cluster id) of the cluster to
  3043. // start IP
  3044. // rotation. Specified in the format
  3045. // 'projects/*/locations/*/clusters/*'.
  3046. Name string `json:"name,omitempty"`
  3047. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3048. // project
  3049. // number](https://developers.google.com/console/help/new/#projec
  3050. // tnumber).
  3051. // This field has been deprecated and replaced by the name field.
  3052. ProjectId string `json:"projectId,omitempty"`
  3053. // RotateCredentials: Whether to rotate credentials during IP rotation.
  3054. RotateCredentials bool `json:"rotateCredentials,omitempty"`
  3055. // Zone: Deprecated. The name of the Google Compute
  3056. // Engine
  3057. // [zone](/compute/docs/zones#available) in which the
  3058. // cluster
  3059. // resides.
  3060. // This field has been deprecated and replaced by the name field.
  3061. Zone string `json:"zone,omitempty"`
  3062. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3063. // unconditionally include in API requests. By default, fields with
  3064. // empty values are omitted from API requests. However, any non-pointer,
  3065. // non-interface field appearing in ForceSendFields will be sent to the
  3066. // server regardless of whether the field is empty or not. This may be
  3067. // used to include empty fields in Patch requests.
  3068. ForceSendFields []string `json:"-"`
  3069. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3070. // API requests with the JSON null value. By default, fields with empty
  3071. // values are omitted from API requests. However, any field with an
  3072. // empty value appearing in NullFields will be sent to the server as
  3073. // null. It is an error if a field in this list has a non-empty value.
  3074. // This may be used to include null fields in Patch requests.
  3075. NullFields []string `json:"-"`
  3076. }
  3077. func (s *StartIPRotationRequest) MarshalJSON() ([]byte, error) {
  3078. type NoMethod StartIPRotationRequest
  3079. raw := NoMethod(*s)
  3080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3081. }
  3082. // StatusCondition: StatusCondition describes why a cluster or a node
  3083. // pool has a certain status
  3084. // (e.g., ERROR or DEGRADED).
  3085. type StatusCondition struct {
  3086. // Code: Machine-friendly representation of the condition
  3087. //
  3088. // Possible values:
  3089. // "UNKNOWN" - UNKNOWN indicates a generic condition.
  3090. // "GCE_STOCKOUT" - GCE_STOCKOUT indicates a Google Compute Engine
  3091. // stockout.
  3092. // "GKE_SERVICE_ACCOUNT_DELETED" - GKE_SERVICE_ACCOUNT_DELETED
  3093. // indicates that the user deleted their robot
  3094. // service account.
  3095. // "GCE_QUOTA_EXCEEDED" - Google Compute Engine quota was exceeded.
  3096. // "SET_BY_OPERATOR" - Cluster state was manually changed by an SRE
  3097. // due to a system logic error.
  3098. // More codes TBA
  3099. Code string `json:"code,omitempty"`
  3100. // Message: Human-friendly representation of the condition
  3101. Message string `json:"message,omitempty"`
  3102. // ForceSendFields is a list of field names (e.g. "Code") to
  3103. // unconditionally include in API requests. By default, fields with
  3104. // empty values are omitted from API requests. However, any non-pointer,
  3105. // non-interface field appearing in ForceSendFields will be sent to the
  3106. // server regardless of whether the field is empty or not. This may be
  3107. // used to include empty fields in Patch requests.
  3108. ForceSendFields []string `json:"-"`
  3109. // NullFields is a list of field names (e.g. "Code") to include in API
  3110. // requests with the JSON null value. By default, fields with empty
  3111. // values are omitted from API requests. However, any field with an
  3112. // empty value appearing in NullFields will be sent to the server as
  3113. // null. It is an error if a field in this list has a non-empty value.
  3114. // This may be used to include null fields in Patch requests.
  3115. NullFields []string `json:"-"`
  3116. }
  3117. func (s *StatusCondition) MarshalJSON() ([]byte, error) {
  3118. type NoMethod StatusCondition
  3119. raw := NoMethod(*s)
  3120. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3121. }
  3122. // UpdateClusterRequest: UpdateClusterRequest updates the settings of a
  3123. // cluster.
  3124. type UpdateClusterRequest struct {
  3125. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3126. // This field has been deprecated and replaced by the name field.
  3127. ClusterId string `json:"clusterId,omitempty"`
  3128. // Name: The name (project, location, cluster) of the cluster to
  3129. // update.
  3130. // Specified in the format 'projects/*/locations/*/clusters/*'.
  3131. Name string `json:"name,omitempty"`
  3132. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3133. // project
  3134. // number](https://support.google.com/cloud/answer/6158840).
  3135. // This
  3136. // field has been deprecated and replaced by the name field.
  3137. ProjectId string `json:"projectId,omitempty"`
  3138. // Update: A description of the update.
  3139. Update *ClusterUpdate `json:"update,omitempty"`
  3140. // Zone: Deprecated. The name of the Google Compute
  3141. // Engine
  3142. // [zone](/compute/docs/zones#available) in which the
  3143. // cluster
  3144. // resides.
  3145. // This field has been deprecated and replaced by the name field.
  3146. Zone string `json:"zone,omitempty"`
  3147. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3148. // unconditionally include in API requests. By default, fields with
  3149. // empty values are omitted from API requests. However, any non-pointer,
  3150. // non-interface field appearing in ForceSendFields will be sent to the
  3151. // server regardless of whether the field is empty or not. This may be
  3152. // used to include empty fields in Patch requests.
  3153. ForceSendFields []string `json:"-"`
  3154. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3155. // API requests with the JSON null value. By default, fields with empty
  3156. // values are omitted from API requests. However, any field with an
  3157. // empty value appearing in NullFields will be sent to the server as
  3158. // null. It is an error if a field in this list has a non-empty value.
  3159. // This may be used to include null fields in Patch requests.
  3160. NullFields []string `json:"-"`
  3161. }
  3162. func (s *UpdateClusterRequest) MarshalJSON() ([]byte, error) {
  3163. type NoMethod UpdateClusterRequest
  3164. raw := NoMethod(*s)
  3165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3166. }
  3167. // UpdateMasterRequest: UpdateMasterRequest updates the master of the
  3168. // cluster.
  3169. type UpdateMasterRequest struct {
  3170. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3171. // This field has been deprecated and replaced by the name field.
  3172. ClusterId string `json:"clusterId,omitempty"`
  3173. // MasterVersion: The Kubernetes version to change the master to.
  3174. //
  3175. // Users may specify either explicit versions offered by Kubernetes
  3176. // Engine or
  3177. // version aliases, which have the following behavior:
  3178. //
  3179. // - "latest": picks the highest valid Kubernetes version
  3180. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  3181. // version
  3182. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  3183. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  3184. // - "-": picks the default Kubernetes version
  3185. MasterVersion string `json:"masterVersion,omitempty"`
  3186. // Name: The name (project, location, cluster) of the cluster to
  3187. // update.
  3188. // Specified in the format 'projects/*/locations/*/clusters/*'.
  3189. Name string `json:"name,omitempty"`
  3190. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3191. // project
  3192. // number](https://support.google.com/cloud/answer/6158840).
  3193. // This
  3194. // field has been deprecated and replaced by the name field.
  3195. ProjectId string `json:"projectId,omitempty"`
  3196. // Zone: Deprecated. The name of the Google Compute
  3197. // Engine
  3198. // [zone](/compute/docs/zones#available) in which the
  3199. // cluster
  3200. // resides.
  3201. // This field has been deprecated and replaced by the name field.
  3202. Zone string `json:"zone,omitempty"`
  3203. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3204. // unconditionally include in API requests. By default, fields with
  3205. // empty values are omitted from API requests. However, any non-pointer,
  3206. // non-interface field appearing in ForceSendFields will be sent to the
  3207. // server regardless of whether the field is empty or not. This may be
  3208. // used to include empty fields in Patch requests.
  3209. ForceSendFields []string `json:"-"`
  3210. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3211. // API requests with the JSON null value. By default, fields with empty
  3212. // values are omitted from API requests. However, any field with an
  3213. // empty value appearing in NullFields will be sent to the server as
  3214. // null. It is an error if a field in this list has a non-empty value.
  3215. // This may be used to include null fields in Patch requests.
  3216. NullFields []string `json:"-"`
  3217. }
  3218. func (s *UpdateMasterRequest) MarshalJSON() ([]byte, error) {
  3219. type NoMethod UpdateMasterRequest
  3220. raw := NoMethod(*s)
  3221. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3222. }
  3223. // UpdateNodePoolRequest: UpdateNodePoolRequests update a node pool's
  3224. // image and/or version.
  3225. type UpdateNodePoolRequest struct {
  3226. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3227. // This field has been deprecated and replaced by the name field.
  3228. ClusterId string `json:"clusterId,omitempty"`
  3229. // ImageType: The desired image type for the node pool.
  3230. ImageType string `json:"imageType,omitempty"`
  3231. // Name: The name (project, location, cluster, node pool) of the node
  3232. // pool to
  3233. // update. Specified in the
  3234. // format
  3235. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  3236. Name string `json:"name,omitempty"`
  3237. // NodePoolId: Deprecated. The name of the node pool to upgrade.
  3238. // This field has been deprecated and replaced by the name field.
  3239. NodePoolId string `json:"nodePoolId,omitempty"`
  3240. // NodeVersion: The Kubernetes version to change the nodes to (typically
  3241. // an
  3242. // upgrade).
  3243. //
  3244. // Users may specify either explicit versions offered by Kubernetes
  3245. // Engine or
  3246. // version aliases, which have the following behavior:
  3247. //
  3248. // - "latest": picks the highest valid Kubernetes version
  3249. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  3250. // version
  3251. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  3252. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  3253. // - "-": picks the Kubernetes master version
  3254. NodeVersion string `json:"nodeVersion,omitempty"`
  3255. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3256. // project
  3257. // number](https://support.google.com/cloud/answer/6158840).
  3258. // This
  3259. // field has been deprecated and replaced by the name field.
  3260. ProjectId string `json:"projectId,omitempty"`
  3261. // Zone: Deprecated. The name of the Google Compute
  3262. // Engine
  3263. // [zone](/compute/docs/zones#available) in which the
  3264. // cluster
  3265. // resides.
  3266. // This field has been deprecated and replaced by the name field.
  3267. Zone string `json:"zone,omitempty"`
  3268. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3269. // unconditionally include in API requests. By default, fields with
  3270. // empty values are omitted from API requests. However, any non-pointer,
  3271. // non-interface field appearing in ForceSendFields will be sent to the
  3272. // server regardless of whether the field is empty or not. This may be
  3273. // used to include empty fields in Patch requests.
  3274. ForceSendFields []string `json:"-"`
  3275. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3276. // API requests with the JSON null value. By default, fields with empty
  3277. // values are omitted from API requests. However, any field with an
  3278. // empty value appearing in NullFields will be sent to the server as
  3279. // null. It is an error if a field in this list has a non-empty value.
  3280. // This may be used to include null fields in Patch requests.
  3281. NullFields []string `json:"-"`
  3282. }
  3283. func (s *UpdateNodePoolRequest) MarshalJSON() ([]byte, error) {
  3284. type NoMethod UpdateNodePoolRequest
  3285. raw := NoMethod(*s)
  3286. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3287. }
  3288. // UsableSubnetwork: UsableSubnetwork resource returns the subnetwork
  3289. // name, its associated network
  3290. // and the primary CIDR range.
  3291. type UsableSubnetwork struct {
  3292. // IpCidrRange: The range of internal addresses that are owned by this
  3293. // subnetwork.
  3294. IpCidrRange string `json:"ipCidrRange,omitempty"`
  3295. // Network: Network Name.
  3296. // Example: projects/my-project/global/networks/my-network
  3297. Network string `json:"network,omitempty"`
  3298. // SecondaryIpRanges: Secondary IP ranges.
  3299. SecondaryIpRanges []*UsableSubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  3300. // StatusMessage: A human readable status message representing the
  3301. // reasons for cases where
  3302. // the caller cannot use the secondary ranges under the subnet. For
  3303. // example if
  3304. // the secondary_ip_ranges is empty due to a permission issue, an
  3305. // insufficient
  3306. // permission message will be given by status_message.
  3307. StatusMessage string `json:"statusMessage,omitempty"`
  3308. // Subnetwork: Subnetwork Name.
  3309. // Example:
  3310. // projects/my-project/regions/us-central1/subnetworks/my-subnet
  3311. Subnetwork string `json:"subnetwork,omitempty"`
  3312. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  3313. // unconditionally include in API requests. By default, fields with
  3314. // empty values are omitted from API requests. However, any non-pointer,
  3315. // non-interface field appearing in ForceSendFields will be sent to the
  3316. // server regardless of whether the field is empty or not. This may be
  3317. // used to include empty fields in Patch requests.
  3318. ForceSendFields []string `json:"-"`
  3319. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  3320. // in API requests with the JSON null value. By default, fields with
  3321. // empty values are omitted from API requests. However, any field with
  3322. // an empty value appearing in NullFields will be sent to the server as
  3323. // null. It is an error if a field in this list has a non-empty value.
  3324. // This may be used to include null fields in Patch requests.
  3325. NullFields []string `json:"-"`
  3326. }
  3327. func (s *UsableSubnetwork) MarshalJSON() ([]byte, error) {
  3328. type NoMethod UsableSubnetwork
  3329. raw := NoMethod(*s)
  3330. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3331. }
  3332. // UsableSubnetworkSecondaryRange: Secondary IP range of a usable
  3333. // subnetwork.
  3334. type UsableSubnetworkSecondaryRange struct {
  3335. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  3336. // secondary range.
  3337. IpCidrRange string `json:"ipCidrRange,omitempty"`
  3338. // RangeName: The name associated with this subnetwork secondary range,
  3339. // used when adding
  3340. // an alias IP range to a VM instance.
  3341. RangeName string `json:"rangeName,omitempty"`
  3342. // Status: This field is to determine the status of the secondary range
  3343. // programmably.
  3344. //
  3345. // Possible values:
  3346. // "UNKNOWN" - UNKNOWN is the zero value of the Status enum. It's not
  3347. // a valid status.
  3348. // "UNUSED" - UNUSED denotes that this range is unclaimed by any
  3349. // cluster.
  3350. // "IN_USE_SERVICE" - IN_USE_SERVICE denotes that this range is
  3351. // claimed by a cluster for
  3352. // services. It cannot be used for other clusters.
  3353. // "IN_USE_SHAREABLE_POD" - IN_USE_SHAREABLE_POD denotes this range
  3354. // was created by the network admin
  3355. // and is currently claimed by a cluster for pods. It can only be used
  3356. // by
  3357. // other clusters as a pod range.
  3358. // "IN_USE_MANAGED_POD" - IN_USE_MANAGED_POD denotes this range was
  3359. // created by GKE and is claimed
  3360. // for pods. It cannot be used for other clusters.
  3361. Status string `json:"status,omitempty"`
  3362. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  3363. // unconditionally include in API requests. By default, fields with
  3364. // empty values are omitted from API requests. However, any non-pointer,
  3365. // non-interface field appearing in ForceSendFields will be sent to the
  3366. // server regardless of whether the field is empty or not. This may be
  3367. // used to include empty fields in Patch requests.
  3368. ForceSendFields []string `json:"-"`
  3369. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  3370. // in API requests with the JSON null value. By default, fields with
  3371. // empty values are omitted from API requests. However, any field with
  3372. // an empty value appearing in NullFields will be sent to the server as
  3373. // null. It is an error if a field in this list has a non-empty value.
  3374. // This may be used to include null fields in Patch requests.
  3375. NullFields []string `json:"-"`
  3376. }
  3377. func (s *UsableSubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  3378. type NoMethod UsableSubnetworkSecondaryRange
  3379. raw := NoMethod(*s)
  3380. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3381. }
  3382. // method id "container.projects.aggregated.usableSubnetworks.list":
  3383. type ProjectsAggregatedUsableSubnetworksListCall struct {
  3384. s *Service
  3385. parent string
  3386. urlParams_ gensupport.URLParams
  3387. ifNoneMatch_ string
  3388. ctx_ context.Context
  3389. header_ http.Header
  3390. }
  3391. // List: Lists subnetworks that are usable for creating clusters in a
  3392. // project.
  3393. func (r *ProjectsAggregatedUsableSubnetworksService) List(parent string) *ProjectsAggregatedUsableSubnetworksListCall {
  3394. c := &ProjectsAggregatedUsableSubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3395. c.parent = parent
  3396. return c
  3397. }
  3398. // Filter sets the optional parameter "filter": Filtering currently only
  3399. // supports equality on the networkProjectId and must
  3400. // be in the form: "networkProjectId=[PROJECTID]", where
  3401. // `networkProjectId`
  3402. // is the project which owns the listed subnetworks. This defaults to
  3403. // the
  3404. // parent project ID.
  3405. func (c *ProjectsAggregatedUsableSubnetworksListCall) Filter(filter string) *ProjectsAggregatedUsableSubnetworksListCall {
  3406. c.urlParams_.Set("filter", filter)
  3407. return c
  3408. }
  3409. // PageSize sets the optional parameter "pageSize": The max number of
  3410. // results per page that should be returned. If the number
  3411. // of available results is larger than `page_size`, a `next_page_token`
  3412. // is
  3413. // returned which can be used to get the next page of results in
  3414. // subsequent
  3415. // requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
  3416. func (c *ProjectsAggregatedUsableSubnetworksListCall) PageSize(pageSize int64) *ProjectsAggregatedUsableSubnetworksListCall {
  3417. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3418. return c
  3419. }
  3420. // PageToken sets the optional parameter "pageToken": Specifies a page
  3421. // token to use. Set this to the nextPageToken returned by
  3422. // previous list requests to get the next page of results.
  3423. func (c *ProjectsAggregatedUsableSubnetworksListCall) PageToken(pageToken string) *ProjectsAggregatedUsableSubnetworksListCall {
  3424. c.urlParams_.Set("pageToken", pageToken)
  3425. return c
  3426. }
  3427. // Fields allows partial responses to be retrieved. See
  3428. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3429. // for more information.
  3430. func (c *ProjectsAggregatedUsableSubnetworksListCall) Fields(s ...googleapi.Field) *ProjectsAggregatedUsableSubnetworksListCall {
  3431. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3432. return c
  3433. }
  3434. // IfNoneMatch sets the optional parameter which makes the operation
  3435. // fail if the object's ETag matches the given value. This is useful for
  3436. // getting updates only after the object has changed since the last
  3437. // request. Use googleapi.IsNotModified to check whether the response
  3438. // error from Do is the result of In-None-Match.
  3439. func (c *ProjectsAggregatedUsableSubnetworksListCall) IfNoneMatch(entityTag string) *ProjectsAggregatedUsableSubnetworksListCall {
  3440. c.ifNoneMatch_ = entityTag
  3441. return c
  3442. }
  3443. // Context sets the context to be used in this call's Do method. Any
  3444. // pending HTTP request will be aborted if the provided context is
  3445. // canceled.
  3446. func (c *ProjectsAggregatedUsableSubnetworksListCall) Context(ctx context.Context) *ProjectsAggregatedUsableSubnetworksListCall {
  3447. c.ctx_ = ctx
  3448. return c
  3449. }
  3450. // Header returns an http.Header that can be modified by the caller to
  3451. // add HTTP headers to the request.
  3452. func (c *ProjectsAggregatedUsableSubnetworksListCall) Header() http.Header {
  3453. if c.header_ == nil {
  3454. c.header_ = make(http.Header)
  3455. }
  3456. return c.header_
  3457. }
  3458. func (c *ProjectsAggregatedUsableSubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  3459. reqHeaders := make(http.Header)
  3460. for k, v := range c.header_ {
  3461. reqHeaders[k] = v
  3462. }
  3463. reqHeaders.Set("User-Agent", c.s.userAgent())
  3464. if c.ifNoneMatch_ != "" {
  3465. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3466. }
  3467. var body io.Reader = nil
  3468. c.urlParams_.Set("alt", alt)
  3469. c.urlParams_.Set("prettyPrint", "false")
  3470. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/aggregated/usableSubnetworks")
  3471. urls += "?" + c.urlParams_.Encode()
  3472. req, err := http.NewRequest("GET", urls, body)
  3473. if err != nil {
  3474. return nil, err
  3475. }
  3476. req.Header = reqHeaders
  3477. googleapi.Expand(req.URL, map[string]string{
  3478. "parent": c.parent,
  3479. })
  3480. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3481. }
  3482. // Do executes the "container.projects.aggregated.usableSubnetworks.list" call.
  3483. // Exactly one of *ListUsableSubnetworksResponse or error will be
  3484. // non-nil. Any non-2xx status code is an error. Response headers are in
  3485. // either *ListUsableSubnetworksResponse.ServerResponse.Header or (if a
  3486. // response was returned at all) in error.(*googleapi.Error).Header. Use
  3487. // googleapi.IsNotModified to check whether the returned error was
  3488. // because http.StatusNotModified was returned.
  3489. func (c *ProjectsAggregatedUsableSubnetworksListCall) Do(opts ...googleapi.CallOption) (*ListUsableSubnetworksResponse, error) {
  3490. gensupport.SetOptions(c.urlParams_, opts...)
  3491. res, err := c.doRequest("json")
  3492. if res != nil && res.StatusCode == http.StatusNotModified {
  3493. if res.Body != nil {
  3494. res.Body.Close()
  3495. }
  3496. return nil, &googleapi.Error{
  3497. Code: res.StatusCode,
  3498. Header: res.Header,
  3499. }
  3500. }
  3501. if err != nil {
  3502. return nil, err
  3503. }
  3504. defer googleapi.CloseBody(res)
  3505. if err := googleapi.CheckResponse(res); err != nil {
  3506. return nil, err
  3507. }
  3508. ret := &ListUsableSubnetworksResponse{
  3509. ServerResponse: googleapi.ServerResponse{
  3510. Header: res.Header,
  3511. HTTPStatusCode: res.StatusCode,
  3512. },
  3513. }
  3514. target := &ret
  3515. if err := gensupport.DecodeResponse(target, res); err != nil {
  3516. return nil, err
  3517. }
  3518. return ret, nil
  3519. // {
  3520. // "description": "Lists subnetworks that are usable for creating clusters in a project.",
  3521. // "flatPath": "v1/projects/{projectsId}/aggregated/usableSubnetworks",
  3522. // "httpMethod": "GET",
  3523. // "id": "container.projects.aggregated.usableSubnetworks.list",
  3524. // "parameterOrder": [
  3525. // "parent"
  3526. // ],
  3527. // "parameters": {
  3528. // "filter": {
  3529. // "description": "Filtering currently only supports equality on the networkProjectId and must\nbe in the form: \"networkProjectId=[PROJECTID]\", where `networkProjectId`\nis the project which owns the listed subnetworks. This defaults to the\nparent project ID.",
  3530. // "location": "query",
  3531. // "type": "string"
  3532. // },
  3533. // "pageSize": {
  3534. // "description": "The max number of results per page that should be returned. If the number\nof available results is larger than `page_size`, a `next_page_token` is\nreturned which can be used to get the next page of results in subsequent\nrequests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  3535. // "format": "int32",
  3536. // "location": "query",
  3537. // "type": "integer"
  3538. // },
  3539. // "pageToken": {
  3540. // "description": "Specifies a page token to use. Set this to the nextPageToken returned by\nprevious list requests to get the next page of results.",
  3541. // "location": "query",
  3542. // "type": "string"
  3543. // },
  3544. // "parent": {
  3545. // "description": "The parent project where subnetworks are usable.\nSpecified in the format 'projects/*'.",
  3546. // "location": "path",
  3547. // "pattern": "^projects/[^/]+$",
  3548. // "required": true,
  3549. // "type": "string"
  3550. // }
  3551. // },
  3552. // "path": "v1/{+parent}/aggregated/usableSubnetworks",
  3553. // "response": {
  3554. // "$ref": "ListUsableSubnetworksResponse"
  3555. // },
  3556. // "scopes": [
  3557. // "https://www.googleapis.com/auth/cloud-platform"
  3558. // ]
  3559. // }
  3560. }
  3561. // Pages invokes f for each page of results.
  3562. // A non-nil error returned from f will halt the iteration.
  3563. // The provided context supersedes any context provided to the Context method.
  3564. func (c *ProjectsAggregatedUsableSubnetworksListCall) Pages(ctx context.Context, f func(*ListUsableSubnetworksResponse) error) error {
  3565. c.ctx_ = ctx
  3566. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3567. for {
  3568. x, err := c.Do()
  3569. if err != nil {
  3570. return err
  3571. }
  3572. if err := f(x); err != nil {
  3573. return err
  3574. }
  3575. if x.NextPageToken == "" {
  3576. return nil
  3577. }
  3578. c.PageToken(x.NextPageToken)
  3579. }
  3580. }
  3581. // method id "container.projects.locations.getServerConfig":
  3582. type ProjectsLocationsGetServerConfigCall struct {
  3583. s *Service
  3584. name string
  3585. urlParams_ gensupport.URLParams
  3586. ifNoneMatch_ string
  3587. ctx_ context.Context
  3588. header_ http.Header
  3589. }
  3590. // GetServerConfig: Returns configuration info about the Google
  3591. // Kubernetes Engine service.
  3592. func (r *ProjectsLocationsService) GetServerConfig(name string) *ProjectsLocationsGetServerConfigCall {
  3593. c := &ProjectsLocationsGetServerConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3594. c.name = name
  3595. return c
  3596. }
  3597. // ProjectId sets the optional parameter "projectId": Deprecated. The
  3598. // Google Developers Console [project ID or
  3599. // project
  3600. // number](https://support.google.com/cloud/answer/6158840).
  3601. // This
  3602. // field has been deprecated and replaced by the name field.
  3603. func (c *ProjectsLocationsGetServerConfigCall) ProjectId(projectId string) *ProjectsLocationsGetServerConfigCall {
  3604. c.urlParams_.Set("projectId", projectId)
  3605. return c
  3606. }
  3607. // Zone sets the optional parameter "zone": Deprecated. The name of the
  3608. // Google Compute Engine
  3609. // [zone](/compute/docs/zones#available) to return operations for.
  3610. // This field has been deprecated and replaced by the name field.
  3611. func (c *ProjectsLocationsGetServerConfigCall) Zone(zone string) *ProjectsLocationsGetServerConfigCall {
  3612. c.urlParams_.Set("zone", zone)
  3613. return c
  3614. }
  3615. // Fields allows partial responses to be retrieved. See
  3616. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3617. // for more information.
  3618. func (c *ProjectsLocationsGetServerConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetServerConfigCall {
  3619. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3620. return c
  3621. }
  3622. // IfNoneMatch sets the optional parameter which makes the operation
  3623. // fail if the object's ETag matches the given value. This is useful for
  3624. // getting updates only after the object has changed since the last
  3625. // request. Use googleapi.IsNotModified to check whether the response
  3626. // error from Do is the result of In-None-Match.
  3627. func (c *ProjectsLocationsGetServerConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetServerConfigCall {
  3628. c.ifNoneMatch_ = entityTag
  3629. return c
  3630. }
  3631. // Context sets the context to be used in this call's Do method. Any
  3632. // pending HTTP request will be aborted if the provided context is
  3633. // canceled.
  3634. func (c *ProjectsLocationsGetServerConfigCall) Context(ctx context.Context) *ProjectsLocationsGetServerConfigCall {
  3635. c.ctx_ = ctx
  3636. return c
  3637. }
  3638. // Header returns an http.Header that can be modified by the caller to
  3639. // add HTTP headers to the request.
  3640. func (c *ProjectsLocationsGetServerConfigCall) Header() http.Header {
  3641. if c.header_ == nil {
  3642. c.header_ = make(http.Header)
  3643. }
  3644. return c.header_
  3645. }
  3646. func (c *ProjectsLocationsGetServerConfigCall) doRequest(alt string) (*http.Response, error) {
  3647. reqHeaders := make(http.Header)
  3648. for k, v := range c.header_ {
  3649. reqHeaders[k] = v
  3650. }
  3651. reqHeaders.Set("User-Agent", c.s.userAgent())
  3652. if c.ifNoneMatch_ != "" {
  3653. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3654. }
  3655. var body io.Reader = nil
  3656. c.urlParams_.Set("alt", alt)
  3657. c.urlParams_.Set("prettyPrint", "false")
  3658. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/serverConfig")
  3659. urls += "?" + c.urlParams_.Encode()
  3660. req, err := http.NewRequest("GET", urls, body)
  3661. if err != nil {
  3662. return nil, err
  3663. }
  3664. req.Header = reqHeaders
  3665. googleapi.Expand(req.URL, map[string]string{
  3666. "name": c.name,
  3667. })
  3668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3669. }
  3670. // Do executes the "container.projects.locations.getServerConfig" call.
  3671. // Exactly one of *ServerConfig or error will be non-nil. Any non-2xx
  3672. // status code is an error. Response headers are in either
  3673. // *ServerConfig.ServerResponse.Header or (if a response was returned at
  3674. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3675. // to check whether the returned error was because
  3676. // http.StatusNotModified was returned.
  3677. func (c *ProjectsLocationsGetServerConfigCall) Do(opts ...googleapi.CallOption) (*ServerConfig, error) {
  3678. gensupport.SetOptions(c.urlParams_, opts...)
  3679. res, err := c.doRequest("json")
  3680. if res != nil && res.StatusCode == http.StatusNotModified {
  3681. if res.Body != nil {
  3682. res.Body.Close()
  3683. }
  3684. return nil, &googleapi.Error{
  3685. Code: res.StatusCode,
  3686. Header: res.Header,
  3687. }
  3688. }
  3689. if err != nil {
  3690. return nil, err
  3691. }
  3692. defer googleapi.CloseBody(res)
  3693. if err := googleapi.CheckResponse(res); err != nil {
  3694. return nil, err
  3695. }
  3696. ret := &ServerConfig{
  3697. ServerResponse: googleapi.ServerResponse{
  3698. Header: res.Header,
  3699. HTTPStatusCode: res.StatusCode,
  3700. },
  3701. }
  3702. target := &ret
  3703. if err := gensupport.DecodeResponse(target, res); err != nil {
  3704. return nil, err
  3705. }
  3706. return ret, nil
  3707. // {
  3708. // "description": "Returns configuration info about the Google Kubernetes Engine service.",
  3709. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/serverConfig",
  3710. // "httpMethod": "GET",
  3711. // "id": "container.projects.locations.getServerConfig",
  3712. // "parameterOrder": [
  3713. // "name"
  3714. // ],
  3715. // "parameters": {
  3716. // "name": {
  3717. // "description": "The name (project and location) of the server config to get,\nspecified in the format 'projects/*/locations/*'.",
  3718. // "location": "path",
  3719. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  3720. // "required": true,
  3721. // "type": "string"
  3722. // },
  3723. // "projectId": {
  3724. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  3725. // "location": "query",
  3726. // "type": "string"
  3727. // },
  3728. // "zone": {
  3729. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) to return operations for.\nThis field has been deprecated and replaced by the name field.",
  3730. // "location": "query",
  3731. // "type": "string"
  3732. // }
  3733. // },
  3734. // "path": "v1/{+name}/serverConfig",
  3735. // "response": {
  3736. // "$ref": "ServerConfig"
  3737. // },
  3738. // "scopes": [
  3739. // "https://www.googleapis.com/auth/cloud-platform"
  3740. // ]
  3741. // }
  3742. }
  3743. // method id "container.projects.locations.clusters.completeIpRotation":
  3744. type ProjectsLocationsClustersCompleteIpRotationCall struct {
  3745. s *Service
  3746. name string
  3747. completeiprotationrequest *CompleteIPRotationRequest
  3748. urlParams_ gensupport.URLParams
  3749. ctx_ context.Context
  3750. header_ http.Header
  3751. }
  3752. // CompleteIpRotation: Completes master IP rotation.
  3753. func (r *ProjectsLocationsClustersService) CompleteIpRotation(name string, completeiprotationrequest *CompleteIPRotationRequest) *ProjectsLocationsClustersCompleteIpRotationCall {
  3754. c := &ProjectsLocationsClustersCompleteIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3755. c.name = name
  3756. c.completeiprotationrequest = completeiprotationrequest
  3757. return c
  3758. }
  3759. // Fields allows partial responses to be retrieved. See
  3760. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3761. // for more information.
  3762. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersCompleteIpRotationCall {
  3763. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3764. return c
  3765. }
  3766. // Context sets the context to be used in this call's Do method. Any
  3767. // pending HTTP request will be aborted if the provided context is
  3768. // canceled.
  3769. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Context(ctx context.Context) *ProjectsLocationsClustersCompleteIpRotationCall {
  3770. c.ctx_ = ctx
  3771. return c
  3772. }
  3773. // Header returns an http.Header that can be modified by the caller to
  3774. // add HTTP headers to the request.
  3775. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Header() http.Header {
  3776. if c.header_ == nil {
  3777. c.header_ = make(http.Header)
  3778. }
  3779. return c.header_
  3780. }
  3781. func (c *ProjectsLocationsClustersCompleteIpRotationCall) doRequest(alt string) (*http.Response, error) {
  3782. reqHeaders := make(http.Header)
  3783. for k, v := range c.header_ {
  3784. reqHeaders[k] = v
  3785. }
  3786. reqHeaders.Set("User-Agent", c.s.userAgent())
  3787. var body io.Reader = nil
  3788. body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeiprotationrequest)
  3789. if err != nil {
  3790. return nil, err
  3791. }
  3792. reqHeaders.Set("Content-Type", "application/json")
  3793. c.urlParams_.Set("alt", alt)
  3794. c.urlParams_.Set("prettyPrint", "false")
  3795. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:completeIpRotation")
  3796. urls += "?" + c.urlParams_.Encode()
  3797. req, err := http.NewRequest("POST", urls, body)
  3798. if err != nil {
  3799. return nil, err
  3800. }
  3801. req.Header = reqHeaders
  3802. googleapi.Expand(req.URL, map[string]string{
  3803. "name": c.name,
  3804. })
  3805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3806. }
  3807. // Do executes the "container.projects.locations.clusters.completeIpRotation" call.
  3808. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3809. // status code is an error. Response headers are in either
  3810. // *Operation.ServerResponse.Header or (if a response was returned at
  3811. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3812. // to check whether the returned error was because
  3813. // http.StatusNotModified was returned.
  3814. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3815. gensupport.SetOptions(c.urlParams_, opts...)
  3816. res, err := c.doRequest("json")
  3817. if res != nil && res.StatusCode == http.StatusNotModified {
  3818. if res.Body != nil {
  3819. res.Body.Close()
  3820. }
  3821. return nil, &googleapi.Error{
  3822. Code: res.StatusCode,
  3823. Header: res.Header,
  3824. }
  3825. }
  3826. if err != nil {
  3827. return nil, err
  3828. }
  3829. defer googleapi.CloseBody(res)
  3830. if err := googleapi.CheckResponse(res); err != nil {
  3831. return nil, err
  3832. }
  3833. ret := &Operation{
  3834. ServerResponse: googleapi.ServerResponse{
  3835. Header: res.Header,
  3836. HTTPStatusCode: res.StatusCode,
  3837. },
  3838. }
  3839. target := &ret
  3840. if err := gensupport.DecodeResponse(target, res); err != nil {
  3841. return nil, err
  3842. }
  3843. return ret, nil
  3844. // {
  3845. // "description": "Completes master IP rotation.",
  3846. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:completeIpRotation",
  3847. // "httpMethod": "POST",
  3848. // "id": "container.projects.locations.clusters.completeIpRotation",
  3849. // "parameterOrder": [
  3850. // "name"
  3851. // ],
  3852. // "parameters": {
  3853. // "name": {
  3854. // "description": "The name (project, location, cluster id) of the cluster to complete IP\nrotation. Specified in the format 'projects/*/locations/*/clusters/*'.",
  3855. // "location": "path",
  3856. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  3857. // "required": true,
  3858. // "type": "string"
  3859. // }
  3860. // },
  3861. // "path": "v1/{+name}:completeIpRotation",
  3862. // "request": {
  3863. // "$ref": "CompleteIPRotationRequest"
  3864. // },
  3865. // "response": {
  3866. // "$ref": "Operation"
  3867. // },
  3868. // "scopes": [
  3869. // "https://www.googleapis.com/auth/cloud-platform"
  3870. // ]
  3871. // }
  3872. }
  3873. // method id "container.projects.locations.clusters.create":
  3874. type ProjectsLocationsClustersCreateCall struct {
  3875. s *Service
  3876. parent string
  3877. createclusterrequest *CreateClusterRequest
  3878. urlParams_ gensupport.URLParams
  3879. ctx_ context.Context
  3880. header_ http.Header
  3881. }
  3882. // Create: Creates a cluster, consisting of the specified number and
  3883. // type of Google
  3884. // Compute Engine instances.
  3885. //
  3886. // By default, the cluster is created in the project's
  3887. // [default
  3888. // network](/compute/docs/networks-and-firewalls#networks).
  3889. //
  3890. // One firewall is added for the cluster. After cluster creation,
  3891. // the Kubelet creates routes for each node to allow the containers
  3892. // on that node to communicate with all other instances in
  3893. // the
  3894. // cluster.
  3895. //
  3896. // Finally, an entry is added to the project's global metadata
  3897. // indicating
  3898. // which CIDR range the cluster is using.
  3899. func (r *ProjectsLocationsClustersService) Create(parent string, createclusterrequest *CreateClusterRequest) *ProjectsLocationsClustersCreateCall {
  3900. c := &ProjectsLocationsClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3901. c.parent = parent
  3902. c.createclusterrequest = createclusterrequest
  3903. return c
  3904. }
  3905. // Fields allows partial responses to be retrieved. See
  3906. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3907. // for more information.
  3908. func (c *ProjectsLocationsClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersCreateCall {
  3909. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3910. return c
  3911. }
  3912. // Context sets the context to be used in this call's Do method. Any
  3913. // pending HTTP request will be aborted if the provided context is
  3914. // canceled.
  3915. func (c *ProjectsLocationsClustersCreateCall) Context(ctx context.Context) *ProjectsLocationsClustersCreateCall {
  3916. c.ctx_ = ctx
  3917. return c
  3918. }
  3919. // Header returns an http.Header that can be modified by the caller to
  3920. // add HTTP headers to the request.
  3921. func (c *ProjectsLocationsClustersCreateCall) Header() http.Header {
  3922. if c.header_ == nil {
  3923. c.header_ = make(http.Header)
  3924. }
  3925. return c.header_
  3926. }
  3927. func (c *ProjectsLocationsClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  3928. reqHeaders := make(http.Header)
  3929. for k, v := range c.header_ {
  3930. reqHeaders[k] = v
  3931. }
  3932. reqHeaders.Set("User-Agent", c.s.userAgent())
  3933. var body io.Reader = nil
  3934. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest)
  3935. if err != nil {
  3936. return nil, err
  3937. }
  3938. reqHeaders.Set("Content-Type", "application/json")
  3939. c.urlParams_.Set("alt", alt)
  3940. c.urlParams_.Set("prettyPrint", "false")
  3941. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters")
  3942. urls += "?" + c.urlParams_.Encode()
  3943. req, err := http.NewRequest("POST", urls, body)
  3944. if err != nil {
  3945. return nil, err
  3946. }
  3947. req.Header = reqHeaders
  3948. googleapi.Expand(req.URL, map[string]string{
  3949. "parent": c.parent,
  3950. })
  3951. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3952. }
  3953. // Do executes the "container.projects.locations.clusters.create" call.
  3954. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3955. // status code is an error. Response headers are in either
  3956. // *Operation.ServerResponse.Header or (if a response was returned at
  3957. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3958. // to check whether the returned error was because
  3959. // http.StatusNotModified was returned.
  3960. func (c *ProjectsLocationsClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3961. gensupport.SetOptions(c.urlParams_, opts...)
  3962. res, err := c.doRequest("json")
  3963. if res != nil && res.StatusCode == http.StatusNotModified {
  3964. if res.Body != nil {
  3965. res.Body.Close()
  3966. }
  3967. return nil, &googleapi.Error{
  3968. Code: res.StatusCode,
  3969. Header: res.Header,
  3970. }
  3971. }
  3972. if err != nil {
  3973. return nil, err
  3974. }
  3975. defer googleapi.CloseBody(res)
  3976. if err := googleapi.CheckResponse(res); err != nil {
  3977. return nil, err
  3978. }
  3979. ret := &Operation{
  3980. ServerResponse: googleapi.ServerResponse{
  3981. Header: res.Header,
  3982. HTTPStatusCode: res.StatusCode,
  3983. },
  3984. }
  3985. target := &ret
  3986. if err := gensupport.DecodeResponse(target, res); err != nil {
  3987. return nil, err
  3988. }
  3989. return ret, nil
  3990. // {
  3991. // "description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe Kubelet creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range the cluster is using.",
  3992. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters",
  3993. // "httpMethod": "POST",
  3994. // "id": "container.projects.locations.clusters.create",
  3995. // "parameterOrder": [
  3996. // "parent"
  3997. // ],
  3998. // "parameters": {
  3999. // "parent": {
  4000. // "description": "The parent (project and location) where the cluster will be created.\nSpecified in the format 'projects/*/locations/*'.",
  4001. // "location": "path",
  4002. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  4003. // "required": true,
  4004. // "type": "string"
  4005. // }
  4006. // },
  4007. // "path": "v1/{+parent}/clusters",
  4008. // "request": {
  4009. // "$ref": "CreateClusterRequest"
  4010. // },
  4011. // "response": {
  4012. // "$ref": "Operation"
  4013. // },
  4014. // "scopes": [
  4015. // "https://www.googleapis.com/auth/cloud-platform"
  4016. // ]
  4017. // }
  4018. }
  4019. // method id "container.projects.locations.clusters.delete":
  4020. type ProjectsLocationsClustersDeleteCall struct {
  4021. s *Service
  4022. name string
  4023. urlParams_ gensupport.URLParams
  4024. ctx_ context.Context
  4025. header_ http.Header
  4026. }
  4027. // Delete: Deletes the cluster, including the Kubernetes endpoint and
  4028. // all worker
  4029. // nodes.
  4030. //
  4031. // Firewalls and routes that were configured during cluster creation
  4032. // are also deleted.
  4033. //
  4034. // Other Google Compute Engine resources that might be in use by the
  4035. // cluster,
  4036. // such as load balancer resources, are not deleted if they weren't
  4037. // present
  4038. // when the cluster was initially created.
  4039. func (r *ProjectsLocationsClustersService) Delete(name string) *ProjectsLocationsClustersDeleteCall {
  4040. c := &ProjectsLocationsClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4041. c.name = name
  4042. return c
  4043. }
  4044. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  4045. // name of the cluster to delete.
  4046. // This field has been deprecated and replaced by the name field.
  4047. func (c *ProjectsLocationsClustersDeleteCall) ClusterId(clusterId string) *ProjectsLocationsClustersDeleteCall {
  4048. c.urlParams_.Set("clusterId", clusterId)
  4049. return c
  4050. }
  4051. // ProjectId sets the optional parameter "projectId": Deprecated. The
  4052. // Google Developers Console [project ID or
  4053. // project
  4054. // number](https://support.google.com/cloud/answer/6158840).
  4055. // This
  4056. // field has been deprecated and replaced by the name field.
  4057. func (c *ProjectsLocationsClustersDeleteCall) ProjectId(projectId string) *ProjectsLocationsClustersDeleteCall {
  4058. c.urlParams_.Set("projectId", projectId)
  4059. return c
  4060. }
  4061. // Zone sets the optional parameter "zone": Deprecated. The name of the
  4062. // Google Compute Engine
  4063. // [zone](/compute/docs/zones#available) in which the
  4064. // cluster
  4065. // resides.
  4066. // This field has been deprecated and replaced by the name field.
  4067. func (c *ProjectsLocationsClustersDeleteCall) Zone(zone string) *ProjectsLocationsClustersDeleteCall {
  4068. c.urlParams_.Set("zone", zone)
  4069. return c
  4070. }
  4071. // Fields allows partial responses to be retrieved. See
  4072. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4073. // for more information.
  4074. func (c *ProjectsLocationsClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersDeleteCall {
  4075. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4076. return c
  4077. }
  4078. // Context sets the context to be used in this call's Do method. Any
  4079. // pending HTTP request will be aborted if the provided context is
  4080. // canceled.
  4081. func (c *ProjectsLocationsClustersDeleteCall) Context(ctx context.Context) *ProjectsLocationsClustersDeleteCall {
  4082. c.ctx_ = ctx
  4083. return c
  4084. }
  4085. // Header returns an http.Header that can be modified by the caller to
  4086. // add HTTP headers to the request.
  4087. func (c *ProjectsLocationsClustersDeleteCall) Header() http.Header {
  4088. if c.header_ == nil {
  4089. c.header_ = make(http.Header)
  4090. }
  4091. return c.header_
  4092. }
  4093. func (c *ProjectsLocationsClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  4094. reqHeaders := make(http.Header)
  4095. for k, v := range c.header_ {
  4096. reqHeaders[k] = v
  4097. }
  4098. reqHeaders.Set("User-Agent", c.s.userAgent())
  4099. var body io.Reader = nil
  4100. c.urlParams_.Set("alt", alt)
  4101. c.urlParams_.Set("prettyPrint", "false")
  4102. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4103. urls += "?" + c.urlParams_.Encode()
  4104. req, err := http.NewRequest("DELETE", urls, body)
  4105. if err != nil {
  4106. return nil, err
  4107. }
  4108. req.Header = reqHeaders
  4109. googleapi.Expand(req.URL, map[string]string{
  4110. "name": c.name,
  4111. })
  4112. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4113. }
  4114. // Do executes the "container.projects.locations.clusters.delete" call.
  4115. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4116. // status code is an error. Response headers are in either
  4117. // *Operation.ServerResponse.Header or (if a response was returned at
  4118. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4119. // to check whether the returned error was because
  4120. // http.StatusNotModified was returned.
  4121. func (c *ProjectsLocationsClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4122. gensupport.SetOptions(c.urlParams_, opts...)
  4123. res, err := c.doRequest("json")
  4124. if res != nil && res.StatusCode == http.StatusNotModified {
  4125. if res.Body != nil {
  4126. res.Body.Close()
  4127. }
  4128. return nil, &googleapi.Error{
  4129. Code: res.StatusCode,
  4130. Header: res.Header,
  4131. }
  4132. }
  4133. if err != nil {
  4134. return nil, err
  4135. }
  4136. defer googleapi.CloseBody(res)
  4137. if err := googleapi.CheckResponse(res); err != nil {
  4138. return nil, err
  4139. }
  4140. ret := &Operation{
  4141. ServerResponse: googleapi.ServerResponse{
  4142. Header: res.Header,
  4143. HTTPStatusCode: res.StatusCode,
  4144. },
  4145. }
  4146. target := &ret
  4147. if err := gensupport.DecodeResponse(target, res); err != nil {
  4148. return nil, err
  4149. }
  4150. return ret, nil
  4151. // {
  4152. // "description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster,\nsuch as load balancer resources, are not deleted if they weren't present\nwhen the cluster was initially created.",
  4153. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
  4154. // "httpMethod": "DELETE",
  4155. // "id": "container.projects.locations.clusters.delete",
  4156. // "parameterOrder": [
  4157. // "name"
  4158. // ],
  4159. // "parameters": {
  4160. // "clusterId": {
  4161. // "description": "Deprecated. The name of the cluster to delete.\nThis field has been deprecated and replaced by the name field.",
  4162. // "location": "query",
  4163. // "type": "string"
  4164. // },
  4165. // "name": {
  4166. // "description": "The name (project, location, cluster) of the cluster to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4167. // "location": "path",
  4168. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4169. // "required": true,
  4170. // "type": "string"
  4171. // },
  4172. // "projectId": {
  4173. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  4174. // "location": "query",
  4175. // "type": "string"
  4176. // },
  4177. // "zone": {
  4178. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  4179. // "location": "query",
  4180. // "type": "string"
  4181. // }
  4182. // },
  4183. // "path": "v1/{+name}",
  4184. // "response": {
  4185. // "$ref": "Operation"
  4186. // },
  4187. // "scopes": [
  4188. // "https://www.googleapis.com/auth/cloud-platform"
  4189. // ]
  4190. // }
  4191. }
  4192. // method id "container.projects.locations.clusters.get":
  4193. type ProjectsLocationsClustersGetCall struct {
  4194. s *Service
  4195. name string
  4196. urlParams_ gensupport.URLParams
  4197. ifNoneMatch_ string
  4198. ctx_ context.Context
  4199. header_ http.Header
  4200. }
  4201. // Get: Gets the details of a specific cluster.
  4202. func (r *ProjectsLocationsClustersService) Get(name string) *ProjectsLocationsClustersGetCall {
  4203. c := &ProjectsLocationsClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4204. c.name = name
  4205. return c
  4206. }
  4207. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  4208. // name of the cluster to retrieve.
  4209. // This field has been deprecated and replaced by the name field.
  4210. func (c *ProjectsLocationsClustersGetCall) ClusterId(clusterId string) *ProjectsLocationsClustersGetCall {
  4211. c.urlParams_.Set("clusterId", clusterId)
  4212. return c
  4213. }
  4214. // ProjectId sets the optional parameter "projectId": Deprecated. The
  4215. // Google Developers Console [project ID or
  4216. // project
  4217. // number](https://support.google.com/cloud/answer/6158840).
  4218. // This
  4219. // field has been deprecated and replaced by the name field.
  4220. func (c *ProjectsLocationsClustersGetCall) ProjectId(projectId string) *ProjectsLocationsClustersGetCall {
  4221. c.urlParams_.Set("projectId", projectId)
  4222. return c
  4223. }
  4224. // Zone sets the optional parameter "zone": Deprecated. The name of the
  4225. // Google Compute Engine
  4226. // [zone](/compute/docs/zones#available) in which the
  4227. // cluster
  4228. // resides.
  4229. // This field has been deprecated and replaced by the name field.
  4230. func (c *ProjectsLocationsClustersGetCall) Zone(zone string) *ProjectsLocationsClustersGetCall {
  4231. c.urlParams_.Set("zone", zone)
  4232. return c
  4233. }
  4234. // Fields allows partial responses to be retrieved. See
  4235. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4236. // for more information.
  4237. func (c *ProjectsLocationsClustersGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersGetCall {
  4238. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4239. return c
  4240. }
  4241. // IfNoneMatch sets the optional parameter which makes the operation
  4242. // fail if the object's ETag matches the given value. This is useful for
  4243. // getting updates only after the object has changed since the last
  4244. // request. Use googleapi.IsNotModified to check whether the response
  4245. // error from Do is the result of In-None-Match.
  4246. func (c *ProjectsLocationsClustersGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersGetCall {
  4247. c.ifNoneMatch_ = entityTag
  4248. return c
  4249. }
  4250. // Context sets the context to be used in this call's Do method. Any
  4251. // pending HTTP request will be aborted if the provided context is
  4252. // canceled.
  4253. func (c *ProjectsLocationsClustersGetCall) Context(ctx context.Context) *ProjectsLocationsClustersGetCall {
  4254. c.ctx_ = ctx
  4255. return c
  4256. }
  4257. // Header returns an http.Header that can be modified by the caller to
  4258. // add HTTP headers to the request.
  4259. func (c *ProjectsLocationsClustersGetCall) Header() http.Header {
  4260. if c.header_ == nil {
  4261. c.header_ = make(http.Header)
  4262. }
  4263. return c.header_
  4264. }
  4265. func (c *ProjectsLocationsClustersGetCall) doRequest(alt string) (*http.Response, error) {
  4266. reqHeaders := make(http.Header)
  4267. for k, v := range c.header_ {
  4268. reqHeaders[k] = v
  4269. }
  4270. reqHeaders.Set("User-Agent", c.s.userAgent())
  4271. if c.ifNoneMatch_ != "" {
  4272. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4273. }
  4274. var body io.Reader = nil
  4275. c.urlParams_.Set("alt", alt)
  4276. c.urlParams_.Set("prettyPrint", "false")
  4277. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4278. urls += "?" + c.urlParams_.Encode()
  4279. req, err := http.NewRequest("GET", urls, body)
  4280. if err != nil {
  4281. return nil, err
  4282. }
  4283. req.Header = reqHeaders
  4284. googleapi.Expand(req.URL, map[string]string{
  4285. "name": c.name,
  4286. })
  4287. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4288. }
  4289. // Do executes the "container.projects.locations.clusters.get" call.
  4290. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  4291. // code is an error. Response headers are in either
  4292. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  4293. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4294. // check whether the returned error was because http.StatusNotModified
  4295. // was returned.
  4296. func (c *ProjectsLocationsClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  4297. gensupport.SetOptions(c.urlParams_, opts...)
  4298. res, err := c.doRequest("json")
  4299. if res != nil && res.StatusCode == http.StatusNotModified {
  4300. if res.Body != nil {
  4301. res.Body.Close()
  4302. }
  4303. return nil, &googleapi.Error{
  4304. Code: res.StatusCode,
  4305. Header: res.Header,
  4306. }
  4307. }
  4308. if err != nil {
  4309. return nil, err
  4310. }
  4311. defer googleapi.CloseBody(res)
  4312. if err := googleapi.CheckResponse(res); err != nil {
  4313. return nil, err
  4314. }
  4315. ret := &Cluster{
  4316. ServerResponse: googleapi.ServerResponse{
  4317. Header: res.Header,
  4318. HTTPStatusCode: res.StatusCode,
  4319. },
  4320. }
  4321. target := &ret
  4322. if err := gensupport.DecodeResponse(target, res); err != nil {
  4323. return nil, err
  4324. }
  4325. return ret, nil
  4326. // {
  4327. // "description": "Gets the details of a specific cluster.",
  4328. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
  4329. // "httpMethod": "GET",
  4330. // "id": "container.projects.locations.clusters.get",
  4331. // "parameterOrder": [
  4332. // "name"
  4333. // ],
  4334. // "parameters": {
  4335. // "clusterId": {
  4336. // "description": "Deprecated. The name of the cluster to retrieve.\nThis field has been deprecated and replaced by the name field.",
  4337. // "location": "query",
  4338. // "type": "string"
  4339. // },
  4340. // "name": {
  4341. // "description": "The name (project, location, cluster) of the cluster to retrieve.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4342. // "location": "path",
  4343. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4344. // "required": true,
  4345. // "type": "string"
  4346. // },
  4347. // "projectId": {
  4348. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  4349. // "location": "query",
  4350. // "type": "string"
  4351. // },
  4352. // "zone": {
  4353. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  4354. // "location": "query",
  4355. // "type": "string"
  4356. // }
  4357. // },
  4358. // "path": "v1/{+name}",
  4359. // "response": {
  4360. // "$ref": "Cluster"
  4361. // },
  4362. // "scopes": [
  4363. // "https://www.googleapis.com/auth/cloud-platform"
  4364. // ]
  4365. // }
  4366. }
  4367. // method id "container.projects.locations.clusters.getJwks":
  4368. type ProjectsLocationsClustersGetJwksCall struct {
  4369. s *Service
  4370. parent string
  4371. urlParams_ gensupport.URLParams
  4372. ifNoneMatch_ string
  4373. ctx_ context.Context
  4374. header_ http.Header
  4375. }
  4376. // GetJwks: Gets the public component of the cluster signing keys
  4377. // in
  4378. // JSON Web Key format.
  4379. // This API is not yet intended for general use, and is not available
  4380. // for all
  4381. // clusters.
  4382. func (r *ProjectsLocationsClustersService) GetJwks(parent string) *ProjectsLocationsClustersGetJwksCall {
  4383. c := &ProjectsLocationsClustersGetJwksCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4384. c.parent = parent
  4385. return c
  4386. }
  4387. // Fields allows partial responses to be retrieved. See
  4388. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4389. // for more information.
  4390. func (c *ProjectsLocationsClustersGetJwksCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersGetJwksCall {
  4391. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4392. return c
  4393. }
  4394. // IfNoneMatch sets the optional parameter which makes the operation
  4395. // fail if the object's ETag matches the given value. This is useful for
  4396. // getting updates only after the object has changed since the last
  4397. // request. Use googleapi.IsNotModified to check whether the response
  4398. // error from Do is the result of In-None-Match.
  4399. func (c *ProjectsLocationsClustersGetJwksCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersGetJwksCall {
  4400. c.ifNoneMatch_ = entityTag
  4401. return c
  4402. }
  4403. // Context sets the context to be used in this call's Do method. Any
  4404. // pending HTTP request will be aborted if the provided context is
  4405. // canceled.
  4406. func (c *ProjectsLocationsClustersGetJwksCall) Context(ctx context.Context) *ProjectsLocationsClustersGetJwksCall {
  4407. c.ctx_ = ctx
  4408. return c
  4409. }
  4410. // Header returns an http.Header that can be modified by the caller to
  4411. // add HTTP headers to the request.
  4412. func (c *ProjectsLocationsClustersGetJwksCall) Header() http.Header {
  4413. if c.header_ == nil {
  4414. c.header_ = make(http.Header)
  4415. }
  4416. return c.header_
  4417. }
  4418. func (c *ProjectsLocationsClustersGetJwksCall) doRequest(alt string) (*http.Response, error) {
  4419. reqHeaders := make(http.Header)
  4420. for k, v := range c.header_ {
  4421. reqHeaders[k] = v
  4422. }
  4423. reqHeaders.Set("User-Agent", c.s.userAgent())
  4424. if c.ifNoneMatch_ != "" {
  4425. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4426. }
  4427. var body io.Reader = nil
  4428. c.urlParams_.Set("alt", alt)
  4429. c.urlParams_.Set("prettyPrint", "false")
  4430. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jwks")
  4431. urls += "?" + c.urlParams_.Encode()
  4432. req, err := http.NewRequest("GET", urls, body)
  4433. if err != nil {
  4434. return nil, err
  4435. }
  4436. req.Header = reqHeaders
  4437. googleapi.Expand(req.URL, map[string]string{
  4438. "parent": c.parent,
  4439. })
  4440. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4441. }
  4442. // Do executes the "container.projects.locations.clusters.getJwks" call.
  4443. // Exactly one of *GetJSONWebKeysResponse or error will be non-nil. Any
  4444. // non-2xx status code is an error. Response headers are in either
  4445. // *GetJSONWebKeysResponse.ServerResponse.Header or (if a response was
  4446. // returned at all) in error.(*googleapi.Error).Header. Use
  4447. // googleapi.IsNotModified to check whether the returned error was
  4448. // because http.StatusNotModified was returned.
  4449. func (c *ProjectsLocationsClustersGetJwksCall) Do(opts ...googleapi.CallOption) (*GetJSONWebKeysResponse, error) {
  4450. gensupport.SetOptions(c.urlParams_, opts...)
  4451. res, err := c.doRequest("json")
  4452. if res != nil && res.StatusCode == http.StatusNotModified {
  4453. if res.Body != nil {
  4454. res.Body.Close()
  4455. }
  4456. return nil, &googleapi.Error{
  4457. Code: res.StatusCode,
  4458. Header: res.Header,
  4459. }
  4460. }
  4461. if err != nil {
  4462. return nil, err
  4463. }
  4464. defer googleapi.CloseBody(res)
  4465. if err := googleapi.CheckResponse(res); err != nil {
  4466. return nil, err
  4467. }
  4468. ret := &GetJSONWebKeysResponse{
  4469. ServerResponse: googleapi.ServerResponse{
  4470. Header: res.Header,
  4471. HTTPStatusCode: res.StatusCode,
  4472. },
  4473. }
  4474. target := &ret
  4475. if err := gensupport.DecodeResponse(target, res); err != nil {
  4476. return nil, err
  4477. }
  4478. return ret, nil
  4479. // {
  4480. // "description": "Gets the public component of the cluster signing keys in\nJSON Web Key format.\nThis API is not yet intended for general use, and is not available for all\nclusters.",
  4481. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/jwks",
  4482. // "httpMethod": "GET",
  4483. // "id": "container.projects.locations.clusters.getJwks",
  4484. // "parameterOrder": [
  4485. // "parent"
  4486. // ],
  4487. // "parameters": {
  4488. // "parent": {
  4489. // "description": "The cluster (project, location, cluster id) to get keys for. Specified in\nthe format 'projects/*/locations/*/clusters/*'.",
  4490. // "location": "path",
  4491. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4492. // "required": true,
  4493. // "type": "string"
  4494. // }
  4495. // },
  4496. // "path": "v1/{+parent}/jwks",
  4497. // "response": {
  4498. // "$ref": "GetJSONWebKeysResponse"
  4499. // }
  4500. // }
  4501. }
  4502. // method id "container.projects.locations.clusters.list":
  4503. type ProjectsLocationsClustersListCall struct {
  4504. s *Service
  4505. parent string
  4506. urlParams_ gensupport.URLParams
  4507. ifNoneMatch_ string
  4508. ctx_ context.Context
  4509. header_ http.Header
  4510. }
  4511. // List: Lists all clusters owned by a project in either the specified
  4512. // zone or all
  4513. // zones.
  4514. func (r *ProjectsLocationsClustersService) List(parent string) *ProjectsLocationsClustersListCall {
  4515. c := &ProjectsLocationsClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4516. c.parent = parent
  4517. return c
  4518. }
  4519. // ProjectId sets the optional parameter "projectId": Deprecated. The
  4520. // Google Developers Console [project ID or
  4521. // project
  4522. // number](https://support.google.com/cloud/answer/6158840).
  4523. // This
  4524. // field has been deprecated and replaced by the parent field.
  4525. func (c *ProjectsLocationsClustersListCall) ProjectId(projectId string) *ProjectsLocationsClustersListCall {
  4526. c.urlParams_.Set("projectId", projectId)
  4527. return c
  4528. }
  4529. // Zone sets the optional parameter "zone": Deprecated. The name of the
  4530. // Google Compute Engine
  4531. // [zone](/compute/docs/zones#available) in which the cluster
  4532. // resides, or "-" for all zones.
  4533. // This field has been deprecated and replaced by the parent field.
  4534. func (c *ProjectsLocationsClustersListCall) Zone(zone string) *ProjectsLocationsClustersListCall {
  4535. c.urlParams_.Set("zone", zone)
  4536. return c
  4537. }
  4538. // Fields allows partial responses to be retrieved. See
  4539. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4540. // for more information.
  4541. func (c *ProjectsLocationsClustersListCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersListCall {
  4542. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4543. return c
  4544. }
  4545. // IfNoneMatch sets the optional parameter which makes the operation
  4546. // fail if the object's ETag matches the given value. This is useful for
  4547. // getting updates only after the object has changed since the last
  4548. // request. Use googleapi.IsNotModified to check whether the response
  4549. // error from Do is the result of In-None-Match.
  4550. func (c *ProjectsLocationsClustersListCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersListCall {
  4551. c.ifNoneMatch_ = entityTag
  4552. return c
  4553. }
  4554. // Context sets the context to be used in this call's Do method. Any
  4555. // pending HTTP request will be aborted if the provided context is
  4556. // canceled.
  4557. func (c *ProjectsLocationsClustersListCall) Context(ctx context.Context) *ProjectsLocationsClustersListCall {
  4558. c.ctx_ = ctx
  4559. return c
  4560. }
  4561. // Header returns an http.Header that can be modified by the caller to
  4562. // add HTTP headers to the request.
  4563. func (c *ProjectsLocationsClustersListCall) Header() http.Header {
  4564. if c.header_ == nil {
  4565. c.header_ = make(http.Header)
  4566. }
  4567. return c.header_
  4568. }
  4569. func (c *ProjectsLocationsClustersListCall) doRequest(alt string) (*http.Response, error) {
  4570. reqHeaders := make(http.Header)
  4571. for k, v := range c.header_ {
  4572. reqHeaders[k] = v
  4573. }
  4574. reqHeaders.Set("User-Agent", c.s.userAgent())
  4575. if c.ifNoneMatch_ != "" {
  4576. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4577. }
  4578. var body io.Reader = nil
  4579. c.urlParams_.Set("alt", alt)
  4580. c.urlParams_.Set("prettyPrint", "false")
  4581. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters")
  4582. urls += "?" + c.urlParams_.Encode()
  4583. req, err := http.NewRequest("GET", urls, body)
  4584. if err != nil {
  4585. return nil, err
  4586. }
  4587. req.Header = reqHeaders
  4588. googleapi.Expand(req.URL, map[string]string{
  4589. "parent": c.parent,
  4590. })
  4591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4592. }
  4593. // Do executes the "container.projects.locations.clusters.list" call.
  4594. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  4595. // non-2xx status code is an error. Response headers are in either
  4596. // *ListClustersResponse.ServerResponse.Header or (if a response was
  4597. // returned at all) in error.(*googleapi.Error).Header. Use
  4598. // googleapi.IsNotModified to check whether the returned error was
  4599. // because http.StatusNotModified was returned.
  4600. func (c *ProjectsLocationsClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  4601. gensupport.SetOptions(c.urlParams_, opts...)
  4602. res, err := c.doRequest("json")
  4603. if res != nil && res.StatusCode == http.StatusNotModified {
  4604. if res.Body != nil {
  4605. res.Body.Close()
  4606. }
  4607. return nil, &googleapi.Error{
  4608. Code: res.StatusCode,
  4609. Header: res.Header,
  4610. }
  4611. }
  4612. if err != nil {
  4613. return nil, err
  4614. }
  4615. defer googleapi.CloseBody(res)
  4616. if err := googleapi.CheckResponse(res); err != nil {
  4617. return nil, err
  4618. }
  4619. ret := &ListClustersResponse{
  4620. ServerResponse: googleapi.ServerResponse{
  4621. Header: res.Header,
  4622. HTTPStatusCode: res.StatusCode,
  4623. },
  4624. }
  4625. target := &ret
  4626. if err := gensupport.DecodeResponse(target, res); err != nil {
  4627. return nil, err
  4628. }
  4629. return ret, nil
  4630. // {
  4631. // "description": "Lists all clusters owned by a project in either the specified zone or all\nzones.",
  4632. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters",
  4633. // "httpMethod": "GET",
  4634. // "id": "container.projects.locations.clusters.list",
  4635. // "parameterOrder": [
  4636. // "parent"
  4637. // ],
  4638. // "parameters": {
  4639. // "parent": {
  4640. // "description": "The parent (project and location) where the clusters will be listed.\nSpecified in the format 'projects/*/locations/*'.\nLocation \"-\" matches all zones and all regions.",
  4641. // "location": "path",
  4642. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  4643. // "required": true,
  4644. // "type": "string"
  4645. // },
  4646. // "projectId": {
  4647. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the parent field.",
  4648. // "location": "query",
  4649. // "type": "string"
  4650. // },
  4651. // "zone": {
  4652. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides, or \"-\" for all zones.\nThis field has been deprecated and replaced by the parent field.",
  4653. // "location": "query",
  4654. // "type": "string"
  4655. // }
  4656. // },
  4657. // "path": "v1/{+parent}/clusters",
  4658. // "response": {
  4659. // "$ref": "ListClustersResponse"
  4660. // },
  4661. // "scopes": [
  4662. // "https://www.googleapis.com/auth/cloud-platform"
  4663. // ]
  4664. // }
  4665. }
  4666. // method id "container.projects.locations.clusters.setAddons":
  4667. type ProjectsLocationsClustersSetAddonsCall struct {
  4668. s *Service
  4669. name string
  4670. setaddonsconfigrequest *SetAddonsConfigRequest
  4671. urlParams_ gensupport.URLParams
  4672. ctx_ context.Context
  4673. header_ http.Header
  4674. }
  4675. // SetAddons: Sets the addons for a specific cluster.
  4676. func (r *ProjectsLocationsClustersService) SetAddons(name string, setaddonsconfigrequest *SetAddonsConfigRequest) *ProjectsLocationsClustersSetAddonsCall {
  4677. c := &ProjectsLocationsClustersSetAddonsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4678. c.name = name
  4679. c.setaddonsconfigrequest = setaddonsconfigrequest
  4680. return c
  4681. }
  4682. // Fields allows partial responses to be retrieved. See
  4683. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4684. // for more information.
  4685. func (c *ProjectsLocationsClustersSetAddonsCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetAddonsCall {
  4686. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4687. return c
  4688. }
  4689. // Context sets the context to be used in this call's Do method. Any
  4690. // pending HTTP request will be aborted if the provided context is
  4691. // canceled.
  4692. func (c *ProjectsLocationsClustersSetAddonsCall) Context(ctx context.Context) *ProjectsLocationsClustersSetAddonsCall {
  4693. c.ctx_ = ctx
  4694. return c
  4695. }
  4696. // Header returns an http.Header that can be modified by the caller to
  4697. // add HTTP headers to the request.
  4698. func (c *ProjectsLocationsClustersSetAddonsCall) Header() http.Header {
  4699. if c.header_ == nil {
  4700. c.header_ = make(http.Header)
  4701. }
  4702. return c.header_
  4703. }
  4704. func (c *ProjectsLocationsClustersSetAddonsCall) doRequest(alt string) (*http.Response, error) {
  4705. reqHeaders := make(http.Header)
  4706. for k, v := range c.header_ {
  4707. reqHeaders[k] = v
  4708. }
  4709. reqHeaders.Set("User-Agent", c.s.userAgent())
  4710. var body io.Reader = nil
  4711. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setaddonsconfigrequest)
  4712. if err != nil {
  4713. return nil, err
  4714. }
  4715. reqHeaders.Set("Content-Type", "application/json")
  4716. c.urlParams_.Set("alt", alt)
  4717. c.urlParams_.Set("prettyPrint", "false")
  4718. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setAddons")
  4719. urls += "?" + c.urlParams_.Encode()
  4720. req, err := http.NewRequest("POST", urls, body)
  4721. if err != nil {
  4722. return nil, err
  4723. }
  4724. req.Header = reqHeaders
  4725. googleapi.Expand(req.URL, map[string]string{
  4726. "name": c.name,
  4727. })
  4728. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4729. }
  4730. // Do executes the "container.projects.locations.clusters.setAddons" call.
  4731. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4732. // status code is an error. Response headers are in either
  4733. // *Operation.ServerResponse.Header or (if a response was returned at
  4734. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4735. // to check whether the returned error was because
  4736. // http.StatusNotModified was returned.
  4737. func (c *ProjectsLocationsClustersSetAddonsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4738. gensupport.SetOptions(c.urlParams_, opts...)
  4739. res, err := c.doRequest("json")
  4740. if res != nil && res.StatusCode == http.StatusNotModified {
  4741. if res.Body != nil {
  4742. res.Body.Close()
  4743. }
  4744. return nil, &googleapi.Error{
  4745. Code: res.StatusCode,
  4746. Header: res.Header,
  4747. }
  4748. }
  4749. if err != nil {
  4750. return nil, err
  4751. }
  4752. defer googleapi.CloseBody(res)
  4753. if err := googleapi.CheckResponse(res); err != nil {
  4754. return nil, err
  4755. }
  4756. ret := &Operation{
  4757. ServerResponse: googleapi.ServerResponse{
  4758. Header: res.Header,
  4759. HTTPStatusCode: res.StatusCode,
  4760. },
  4761. }
  4762. target := &ret
  4763. if err := gensupport.DecodeResponse(target, res); err != nil {
  4764. return nil, err
  4765. }
  4766. return ret, nil
  4767. // {
  4768. // "description": "Sets the addons for a specific cluster.",
  4769. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setAddons",
  4770. // "httpMethod": "POST",
  4771. // "id": "container.projects.locations.clusters.setAddons",
  4772. // "parameterOrder": [
  4773. // "name"
  4774. // ],
  4775. // "parameters": {
  4776. // "name": {
  4777. // "description": "The name (project, location, cluster) of the cluster to set addons.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4778. // "location": "path",
  4779. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4780. // "required": true,
  4781. // "type": "string"
  4782. // }
  4783. // },
  4784. // "path": "v1/{+name}:setAddons",
  4785. // "request": {
  4786. // "$ref": "SetAddonsConfigRequest"
  4787. // },
  4788. // "response": {
  4789. // "$ref": "Operation"
  4790. // },
  4791. // "scopes": [
  4792. // "https://www.googleapis.com/auth/cloud-platform"
  4793. // ]
  4794. // }
  4795. }
  4796. // method id "container.projects.locations.clusters.setLegacyAbac":
  4797. type ProjectsLocationsClustersSetLegacyAbacCall struct {
  4798. s *Service
  4799. name string
  4800. setlegacyabacrequest *SetLegacyAbacRequest
  4801. urlParams_ gensupport.URLParams
  4802. ctx_ context.Context
  4803. header_ http.Header
  4804. }
  4805. // SetLegacyAbac: Enables or disables the ABAC authorization mechanism
  4806. // on a cluster.
  4807. func (r *ProjectsLocationsClustersService) SetLegacyAbac(name string, setlegacyabacrequest *SetLegacyAbacRequest) *ProjectsLocationsClustersSetLegacyAbacCall {
  4808. c := &ProjectsLocationsClustersSetLegacyAbacCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4809. c.name = name
  4810. c.setlegacyabacrequest = setlegacyabacrequest
  4811. return c
  4812. }
  4813. // Fields allows partial responses to be retrieved. See
  4814. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4815. // for more information.
  4816. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetLegacyAbacCall {
  4817. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4818. return c
  4819. }
  4820. // Context sets the context to be used in this call's Do method. Any
  4821. // pending HTTP request will be aborted if the provided context is
  4822. // canceled.
  4823. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Context(ctx context.Context) *ProjectsLocationsClustersSetLegacyAbacCall {
  4824. c.ctx_ = ctx
  4825. return c
  4826. }
  4827. // Header returns an http.Header that can be modified by the caller to
  4828. // add HTTP headers to the request.
  4829. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Header() http.Header {
  4830. if c.header_ == nil {
  4831. c.header_ = make(http.Header)
  4832. }
  4833. return c.header_
  4834. }
  4835. func (c *ProjectsLocationsClustersSetLegacyAbacCall) doRequest(alt string) (*http.Response, error) {
  4836. reqHeaders := make(http.Header)
  4837. for k, v := range c.header_ {
  4838. reqHeaders[k] = v
  4839. }
  4840. reqHeaders.Set("User-Agent", c.s.userAgent())
  4841. var body io.Reader = nil
  4842. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlegacyabacrequest)
  4843. if err != nil {
  4844. return nil, err
  4845. }
  4846. reqHeaders.Set("Content-Type", "application/json")
  4847. c.urlParams_.Set("alt", alt)
  4848. c.urlParams_.Set("prettyPrint", "false")
  4849. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setLegacyAbac")
  4850. urls += "?" + c.urlParams_.Encode()
  4851. req, err := http.NewRequest("POST", urls, body)
  4852. if err != nil {
  4853. return nil, err
  4854. }
  4855. req.Header = reqHeaders
  4856. googleapi.Expand(req.URL, map[string]string{
  4857. "name": c.name,
  4858. })
  4859. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4860. }
  4861. // Do executes the "container.projects.locations.clusters.setLegacyAbac" call.
  4862. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4863. // status code is an error. Response headers are in either
  4864. // *Operation.ServerResponse.Header or (if a response was returned at
  4865. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4866. // to check whether the returned error was because
  4867. // http.StatusNotModified was returned.
  4868. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4869. gensupport.SetOptions(c.urlParams_, opts...)
  4870. res, err := c.doRequest("json")
  4871. if res != nil && res.StatusCode == http.StatusNotModified {
  4872. if res.Body != nil {
  4873. res.Body.Close()
  4874. }
  4875. return nil, &googleapi.Error{
  4876. Code: res.StatusCode,
  4877. Header: res.Header,
  4878. }
  4879. }
  4880. if err != nil {
  4881. return nil, err
  4882. }
  4883. defer googleapi.CloseBody(res)
  4884. if err := googleapi.CheckResponse(res); err != nil {
  4885. return nil, err
  4886. }
  4887. ret := &Operation{
  4888. ServerResponse: googleapi.ServerResponse{
  4889. Header: res.Header,
  4890. HTTPStatusCode: res.StatusCode,
  4891. },
  4892. }
  4893. target := &ret
  4894. if err := gensupport.DecodeResponse(target, res); err != nil {
  4895. return nil, err
  4896. }
  4897. return ret, nil
  4898. // {
  4899. // "description": "Enables or disables the ABAC authorization mechanism on a cluster.",
  4900. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLegacyAbac",
  4901. // "httpMethod": "POST",
  4902. // "id": "container.projects.locations.clusters.setLegacyAbac",
  4903. // "parameterOrder": [
  4904. // "name"
  4905. // ],
  4906. // "parameters": {
  4907. // "name": {
  4908. // "description": "The name (project, location, cluster id) of the cluster to set legacy abac.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4909. // "location": "path",
  4910. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4911. // "required": true,
  4912. // "type": "string"
  4913. // }
  4914. // },
  4915. // "path": "v1/{+name}:setLegacyAbac",
  4916. // "request": {
  4917. // "$ref": "SetLegacyAbacRequest"
  4918. // },
  4919. // "response": {
  4920. // "$ref": "Operation"
  4921. // },
  4922. // "scopes": [
  4923. // "https://www.googleapis.com/auth/cloud-platform"
  4924. // ]
  4925. // }
  4926. }
  4927. // method id "container.projects.locations.clusters.setLocations":
  4928. type ProjectsLocationsClustersSetLocationsCall struct {
  4929. s *Service
  4930. name string
  4931. setlocationsrequest *SetLocationsRequest
  4932. urlParams_ gensupport.URLParams
  4933. ctx_ context.Context
  4934. header_ http.Header
  4935. }
  4936. // SetLocations: Sets the locations for a specific cluster.
  4937. func (r *ProjectsLocationsClustersService) SetLocations(name string, setlocationsrequest *SetLocationsRequest) *ProjectsLocationsClustersSetLocationsCall {
  4938. c := &ProjectsLocationsClustersSetLocationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4939. c.name = name
  4940. c.setlocationsrequest = setlocationsrequest
  4941. return c
  4942. }
  4943. // Fields allows partial responses to be retrieved. See
  4944. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4945. // for more information.
  4946. func (c *ProjectsLocationsClustersSetLocationsCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetLocationsCall {
  4947. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4948. return c
  4949. }
  4950. // Context sets the context to be used in this call's Do method. Any
  4951. // pending HTTP request will be aborted if the provided context is
  4952. // canceled.
  4953. func (c *ProjectsLocationsClustersSetLocationsCall) Context(ctx context.Context) *ProjectsLocationsClustersSetLocationsCall {
  4954. c.ctx_ = ctx
  4955. return c
  4956. }
  4957. // Header returns an http.Header that can be modified by the caller to
  4958. // add HTTP headers to the request.
  4959. func (c *ProjectsLocationsClustersSetLocationsCall) Header() http.Header {
  4960. if c.header_ == nil {
  4961. c.header_ = make(http.Header)
  4962. }
  4963. return c.header_
  4964. }
  4965. func (c *ProjectsLocationsClustersSetLocationsCall) doRequest(alt string) (*http.Response, error) {
  4966. reqHeaders := make(http.Header)
  4967. for k, v := range c.header_ {
  4968. reqHeaders[k] = v
  4969. }
  4970. reqHeaders.Set("User-Agent", c.s.userAgent())
  4971. var body io.Reader = nil
  4972. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlocationsrequest)
  4973. if err != nil {
  4974. return nil, err
  4975. }
  4976. reqHeaders.Set("Content-Type", "application/json")
  4977. c.urlParams_.Set("alt", alt)
  4978. c.urlParams_.Set("prettyPrint", "false")
  4979. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setLocations")
  4980. urls += "?" + c.urlParams_.Encode()
  4981. req, err := http.NewRequest("POST", urls, body)
  4982. if err != nil {
  4983. return nil, err
  4984. }
  4985. req.Header = reqHeaders
  4986. googleapi.Expand(req.URL, map[string]string{
  4987. "name": c.name,
  4988. })
  4989. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4990. }
  4991. // Do executes the "container.projects.locations.clusters.setLocations" call.
  4992. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4993. // status code is an error. Response headers are in either
  4994. // *Operation.ServerResponse.Header or (if a response was returned at
  4995. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4996. // to check whether the returned error was because
  4997. // http.StatusNotModified was returned.
  4998. func (c *ProjectsLocationsClustersSetLocationsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4999. gensupport.SetOptions(c.urlParams_, opts...)
  5000. res, err := c.doRequest("json")
  5001. if res != nil && res.StatusCode == http.StatusNotModified {
  5002. if res.Body != nil {
  5003. res.Body.Close()
  5004. }
  5005. return nil, &googleapi.Error{
  5006. Code: res.StatusCode,
  5007. Header: res.Header,
  5008. }
  5009. }
  5010. if err != nil {
  5011. return nil, err
  5012. }
  5013. defer googleapi.CloseBody(res)
  5014. if err := googleapi.CheckResponse(res); err != nil {
  5015. return nil, err
  5016. }
  5017. ret := &Operation{
  5018. ServerResponse: googleapi.ServerResponse{
  5019. Header: res.Header,
  5020. HTTPStatusCode: res.StatusCode,
  5021. },
  5022. }
  5023. target := &ret
  5024. if err := gensupport.DecodeResponse(target, res); err != nil {
  5025. return nil, err
  5026. }
  5027. return ret, nil
  5028. // {
  5029. // "description": "Sets the locations for a specific cluster.",
  5030. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLocations",
  5031. // "httpMethod": "POST",
  5032. // "id": "container.projects.locations.clusters.setLocations",
  5033. // "parameterOrder": [
  5034. // "name"
  5035. // ],
  5036. // "parameters": {
  5037. // "name": {
  5038. // "description": "The name (project, location, cluster) of the cluster to set locations.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5039. // "location": "path",
  5040. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5041. // "required": true,
  5042. // "type": "string"
  5043. // }
  5044. // },
  5045. // "path": "v1/{+name}:setLocations",
  5046. // "request": {
  5047. // "$ref": "SetLocationsRequest"
  5048. // },
  5049. // "response": {
  5050. // "$ref": "Operation"
  5051. // },
  5052. // "scopes": [
  5053. // "https://www.googleapis.com/auth/cloud-platform"
  5054. // ]
  5055. // }
  5056. }
  5057. // method id "container.projects.locations.clusters.setLogging":
  5058. type ProjectsLocationsClustersSetLoggingCall struct {
  5059. s *Service
  5060. name string
  5061. setloggingservicerequest *SetLoggingServiceRequest
  5062. urlParams_ gensupport.URLParams
  5063. ctx_ context.Context
  5064. header_ http.Header
  5065. }
  5066. // SetLogging: Sets the logging service for a specific cluster.
  5067. func (r *ProjectsLocationsClustersService) SetLogging(name string, setloggingservicerequest *SetLoggingServiceRequest) *ProjectsLocationsClustersSetLoggingCall {
  5068. c := &ProjectsLocationsClustersSetLoggingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5069. c.name = name
  5070. c.setloggingservicerequest = setloggingservicerequest
  5071. return c
  5072. }
  5073. // Fields allows partial responses to be retrieved. See
  5074. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5075. // for more information.
  5076. func (c *ProjectsLocationsClustersSetLoggingCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetLoggingCall {
  5077. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5078. return c
  5079. }
  5080. // Context sets the context to be used in this call's Do method. Any
  5081. // pending HTTP request will be aborted if the provided context is
  5082. // canceled.
  5083. func (c *ProjectsLocationsClustersSetLoggingCall) Context(ctx context.Context) *ProjectsLocationsClustersSetLoggingCall {
  5084. c.ctx_ = ctx
  5085. return c
  5086. }
  5087. // Header returns an http.Header that can be modified by the caller to
  5088. // add HTTP headers to the request.
  5089. func (c *ProjectsLocationsClustersSetLoggingCall) Header() http.Header {
  5090. if c.header_ == nil {
  5091. c.header_ = make(http.Header)
  5092. }
  5093. return c.header_
  5094. }
  5095. func (c *ProjectsLocationsClustersSetLoggingCall) doRequest(alt string) (*http.Response, error) {
  5096. reqHeaders := make(http.Header)
  5097. for k, v := range c.header_ {
  5098. reqHeaders[k] = v
  5099. }
  5100. reqHeaders.Set("User-Agent", c.s.userAgent())
  5101. var body io.Reader = nil
  5102. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setloggingservicerequest)
  5103. if err != nil {
  5104. return nil, err
  5105. }
  5106. reqHeaders.Set("Content-Type", "application/json")
  5107. c.urlParams_.Set("alt", alt)
  5108. c.urlParams_.Set("prettyPrint", "false")
  5109. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setLogging")
  5110. urls += "?" + c.urlParams_.Encode()
  5111. req, err := http.NewRequest("POST", urls, body)
  5112. if err != nil {
  5113. return nil, err
  5114. }
  5115. req.Header = reqHeaders
  5116. googleapi.Expand(req.URL, map[string]string{
  5117. "name": c.name,
  5118. })
  5119. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5120. }
  5121. // Do executes the "container.projects.locations.clusters.setLogging" call.
  5122. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5123. // status code is an error. Response headers are in either
  5124. // *Operation.ServerResponse.Header or (if a response was returned at
  5125. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5126. // to check whether the returned error was because
  5127. // http.StatusNotModified was returned.
  5128. func (c *ProjectsLocationsClustersSetLoggingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5129. gensupport.SetOptions(c.urlParams_, opts...)
  5130. res, err := c.doRequest("json")
  5131. if res != nil && res.StatusCode == http.StatusNotModified {
  5132. if res.Body != nil {
  5133. res.Body.Close()
  5134. }
  5135. return nil, &googleapi.Error{
  5136. Code: res.StatusCode,
  5137. Header: res.Header,
  5138. }
  5139. }
  5140. if err != nil {
  5141. return nil, err
  5142. }
  5143. defer googleapi.CloseBody(res)
  5144. if err := googleapi.CheckResponse(res); err != nil {
  5145. return nil, err
  5146. }
  5147. ret := &Operation{
  5148. ServerResponse: googleapi.ServerResponse{
  5149. Header: res.Header,
  5150. HTTPStatusCode: res.StatusCode,
  5151. },
  5152. }
  5153. target := &ret
  5154. if err := gensupport.DecodeResponse(target, res); err != nil {
  5155. return nil, err
  5156. }
  5157. return ret, nil
  5158. // {
  5159. // "description": "Sets the logging service for a specific cluster.",
  5160. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLogging",
  5161. // "httpMethod": "POST",
  5162. // "id": "container.projects.locations.clusters.setLogging",
  5163. // "parameterOrder": [
  5164. // "name"
  5165. // ],
  5166. // "parameters": {
  5167. // "name": {
  5168. // "description": "The name (project, location, cluster) of the cluster to set logging.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5169. // "location": "path",
  5170. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5171. // "required": true,
  5172. // "type": "string"
  5173. // }
  5174. // },
  5175. // "path": "v1/{+name}:setLogging",
  5176. // "request": {
  5177. // "$ref": "SetLoggingServiceRequest"
  5178. // },
  5179. // "response": {
  5180. // "$ref": "Operation"
  5181. // },
  5182. // "scopes": [
  5183. // "https://www.googleapis.com/auth/cloud-platform"
  5184. // ]
  5185. // }
  5186. }
  5187. // method id "container.projects.locations.clusters.setMaintenancePolicy":
  5188. type ProjectsLocationsClustersSetMaintenancePolicyCall struct {
  5189. s *Service
  5190. name string
  5191. setmaintenancepolicyrequest *SetMaintenancePolicyRequest
  5192. urlParams_ gensupport.URLParams
  5193. ctx_ context.Context
  5194. header_ http.Header
  5195. }
  5196. // SetMaintenancePolicy: Sets the maintenance policy for a cluster.
  5197. func (r *ProjectsLocationsClustersService) SetMaintenancePolicy(name string, setmaintenancepolicyrequest *SetMaintenancePolicyRequest) *ProjectsLocationsClustersSetMaintenancePolicyCall {
  5198. c := &ProjectsLocationsClustersSetMaintenancePolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5199. c.name = name
  5200. c.setmaintenancepolicyrequest = setmaintenancepolicyrequest
  5201. return c
  5202. }
  5203. // Fields allows partial responses to be retrieved. See
  5204. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5205. // for more information.
  5206. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetMaintenancePolicyCall {
  5207. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5208. return c
  5209. }
  5210. // Context sets the context to be used in this call's Do method. Any
  5211. // pending HTTP request will be aborted if the provided context is
  5212. // canceled.
  5213. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Context(ctx context.Context) *ProjectsLocationsClustersSetMaintenancePolicyCall {
  5214. c.ctx_ = ctx
  5215. return c
  5216. }
  5217. // Header returns an http.Header that can be modified by the caller to
  5218. // add HTTP headers to the request.
  5219. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Header() http.Header {
  5220. if c.header_ == nil {
  5221. c.header_ = make(http.Header)
  5222. }
  5223. return c.header_
  5224. }
  5225. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) doRequest(alt string) (*http.Response, error) {
  5226. reqHeaders := make(http.Header)
  5227. for k, v := range c.header_ {
  5228. reqHeaders[k] = v
  5229. }
  5230. reqHeaders.Set("User-Agent", c.s.userAgent())
  5231. var body io.Reader = nil
  5232. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmaintenancepolicyrequest)
  5233. if err != nil {
  5234. return nil, err
  5235. }
  5236. reqHeaders.Set("Content-Type", "application/json")
  5237. c.urlParams_.Set("alt", alt)
  5238. c.urlParams_.Set("prettyPrint", "false")
  5239. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMaintenancePolicy")
  5240. urls += "?" + c.urlParams_.Encode()
  5241. req, err := http.NewRequest("POST", urls, body)
  5242. if err != nil {
  5243. return nil, err
  5244. }
  5245. req.Header = reqHeaders
  5246. googleapi.Expand(req.URL, map[string]string{
  5247. "name": c.name,
  5248. })
  5249. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5250. }
  5251. // Do executes the "container.projects.locations.clusters.setMaintenancePolicy" call.
  5252. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5253. // status code is an error. Response headers are in either
  5254. // *Operation.ServerResponse.Header or (if a response was returned at
  5255. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5256. // to check whether the returned error was because
  5257. // http.StatusNotModified was returned.
  5258. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5259. gensupport.SetOptions(c.urlParams_, opts...)
  5260. res, err := c.doRequest("json")
  5261. if res != nil && res.StatusCode == http.StatusNotModified {
  5262. if res.Body != nil {
  5263. res.Body.Close()
  5264. }
  5265. return nil, &googleapi.Error{
  5266. Code: res.StatusCode,
  5267. Header: res.Header,
  5268. }
  5269. }
  5270. if err != nil {
  5271. return nil, err
  5272. }
  5273. defer googleapi.CloseBody(res)
  5274. if err := googleapi.CheckResponse(res); err != nil {
  5275. return nil, err
  5276. }
  5277. ret := &Operation{
  5278. ServerResponse: googleapi.ServerResponse{
  5279. Header: res.Header,
  5280. HTTPStatusCode: res.StatusCode,
  5281. },
  5282. }
  5283. target := &ret
  5284. if err := gensupport.DecodeResponse(target, res); err != nil {
  5285. return nil, err
  5286. }
  5287. return ret, nil
  5288. // {
  5289. // "description": "Sets the maintenance policy for a cluster.",
  5290. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMaintenancePolicy",
  5291. // "httpMethod": "POST",
  5292. // "id": "container.projects.locations.clusters.setMaintenancePolicy",
  5293. // "parameterOrder": [
  5294. // "name"
  5295. // ],
  5296. // "parameters": {
  5297. // "name": {
  5298. // "description": "The name (project, location, cluster id) of the cluster to set maintenance\npolicy.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5299. // "location": "path",
  5300. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5301. // "required": true,
  5302. // "type": "string"
  5303. // }
  5304. // },
  5305. // "path": "v1/{+name}:setMaintenancePolicy",
  5306. // "request": {
  5307. // "$ref": "SetMaintenancePolicyRequest"
  5308. // },
  5309. // "response": {
  5310. // "$ref": "Operation"
  5311. // },
  5312. // "scopes": [
  5313. // "https://www.googleapis.com/auth/cloud-platform"
  5314. // ]
  5315. // }
  5316. }
  5317. // method id "container.projects.locations.clusters.setMasterAuth":
  5318. type ProjectsLocationsClustersSetMasterAuthCall struct {
  5319. s *Service
  5320. name string
  5321. setmasterauthrequest *SetMasterAuthRequest
  5322. urlParams_ gensupport.URLParams
  5323. ctx_ context.Context
  5324. header_ http.Header
  5325. }
  5326. // SetMasterAuth: Sets master auth materials. Currently supports
  5327. // changing the admin password
  5328. // or a specific cluster, either via password generation or explicitly
  5329. // setting
  5330. // the password.
  5331. func (r *ProjectsLocationsClustersService) SetMasterAuth(name string, setmasterauthrequest *SetMasterAuthRequest) *ProjectsLocationsClustersSetMasterAuthCall {
  5332. c := &ProjectsLocationsClustersSetMasterAuthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5333. c.name = name
  5334. c.setmasterauthrequest = setmasterauthrequest
  5335. return c
  5336. }
  5337. // Fields allows partial responses to be retrieved. See
  5338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5339. // for more information.
  5340. func (c *ProjectsLocationsClustersSetMasterAuthCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetMasterAuthCall {
  5341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5342. return c
  5343. }
  5344. // Context sets the context to be used in this call's Do method. Any
  5345. // pending HTTP request will be aborted if the provided context is
  5346. // canceled.
  5347. func (c *ProjectsLocationsClustersSetMasterAuthCall) Context(ctx context.Context) *ProjectsLocationsClustersSetMasterAuthCall {
  5348. c.ctx_ = ctx
  5349. return c
  5350. }
  5351. // Header returns an http.Header that can be modified by the caller to
  5352. // add HTTP headers to the request.
  5353. func (c *ProjectsLocationsClustersSetMasterAuthCall) Header() http.Header {
  5354. if c.header_ == nil {
  5355. c.header_ = make(http.Header)
  5356. }
  5357. return c.header_
  5358. }
  5359. func (c *ProjectsLocationsClustersSetMasterAuthCall) doRequest(alt string) (*http.Response, error) {
  5360. reqHeaders := make(http.Header)
  5361. for k, v := range c.header_ {
  5362. reqHeaders[k] = v
  5363. }
  5364. reqHeaders.Set("User-Agent", c.s.userAgent())
  5365. var body io.Reader = nil
  5366. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmasterauthrequest)
  5367. if err != nil {
  5368. return nil, err
  5369. }
  5370. reqHeaders.Set("Content-Type", "application/json")
  5371. c.urlParams_.Set("alt", alt)
  5372. c.urlParams_.Set("prettyPrint", "false")
  5373. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMasterAuth")
  5374. urls += "?" + c.urlParams_.Encode()
  5375. req, err := http.NewRequest("POST", urls, body)
  5376. if err != nil {
  5377. return nil, err
  5378. }
  5379. req.Header = reqHeaders
  5380. googleapi.Expand(req.URL, map[string]string{
  5381. "name": c.name,
  5382. })
  5383. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5384. }
  5385. // Do executes the "container.projects.locations.clusters.setMasterAuth" call.
  5386. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5387. // status code is an error. Response headers are in either
  5388. // *Operation.ServerResponse.Header or (if a response was returned at
  5389. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5390. // to check whether the returned error was because
  5391. // http.StatusNotModified was returned.
  5392. func (c *ProjectsLocationsClustersSetMasterAuthCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5393. gensupport.SetOptions(c.urlParams_, opts...)
  5394. res, err := c.doRequest("json")
  5395. if res != nil && res.StatusCode == http.StatusNotModified {
  5396. if res.Body != nil {
  5397. res.Body.Close()
  5398. }
  5399. return nil, &googleapi.Error{
  5400. Code: res.StatusCode,
  5401. Header: res.Header,
  5402. }
  5403. }
  5404. if err != nil {
  5405. return nil, err
  5406. }
  5407. defer googleapi.CloseBody(res)
  5408. if err := googleapi.CheckResponse(res); err != nil {
  5409. return nil, err
  5410. }
  5411. ret := &Operation{
  5412. ServerResponse: googleapi.ServerResponse{
  5413. Header: res.Header,
  5414. HTTPStatusCode: res.StatusCode,
  5415. },
  5416. }
  5417. target := &ret
  5418. if err := gensupport.DecodeResponse(target, res); err != nil {
  5419. return nil, err
  5420. }
  5421. return ret, nil
  5422. // {
  5423. // "description": "Sets master auth materials. Currently supports changing the admin password\nor a specific cluster, either via password generation or explicitly setting\nthe password.",
  5424. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMasterAuth",
  5425. // "httpMethod": "POST",
  5426. // "id": "container.projects.locations.clusters.setMasterAuth",
  5427. // "parameterOrder": [
  5428. // "name"
  5429. // ],
  5430. // "parameters": {
  5431. // "name": {
  5432. // "description": "The name (project, location, cluster) of the cluster to set auth.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5433. // "location": "path",
  5434. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5435. // "required": true,
  5436. // "type": "string"
  5437. // }
  5438. // },
  5439. // "path": "v1/{+name}:setMasterAuth",
  5440. // "request": {
  5441. // "$ref": "SetMasterAuthRequest"
  5442. // },
  5443. // "response": {
  5444. // "$ref": "Operation"
  5445. // },
  5446. // "scopes": [
  5447. // "https://www.googleapis.com/auth/cloud-platform"
  5448. // ]
  5449. // }
  5450. }
  5451. // method id "container.projects.locations.clusters.setMonitoring":
  5452. type ProjectsLocationsClustersSetMonitoringCall struct {
  5453. s *Service
  5454. name string
  5455. setmonitoringservicerequest *SetMonitoringServiceRequest
  5456. urlParams_ gensupport.URLParams
  5457. ctx_ context.Context
  5458. header_ http.Header
  5459. }
  5460. // SetMonitoring: Sets the monitoring service for a specific cluster.
  5461. func (r *ProjectsLocationsClustersService) SetMonitoring(name string, setmonitoringservicerequest *SetMonitoringServiceRequest) *ProjectsLocationsClustersSetMonitoringCall {
  5462. c := &ProjectsLocationsClustersSetMonitoringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5463. c.name = name
  5464. c.setmonitoringservicerequest = setmonitoringservicerequest
  5465. return c
  5466. }
  5467. // Fields allows partial responses to be retrieved. See
  5468. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5469. // for more information.
  5470. func (c *ProjectsLocationsClustersSetMonitoringCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetMonitoringCall {
  5471. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5472. return c
  5473. }
  5474. // Context sets the context to be used in this call's Do method. Any
  5475. // pending HTTP request will be aborted if the provided context is
  5476. // canceled.
  5477. func (c *ProjectsLocationsClustersSetMonitoringCall) Context(ctx context.Context) *ProjectsLocationsClustersSetMonitoringCall {
  5478. c.ctx_ = ctx
  5479. return c
  5480. }
  5481. // Header returns an http.Header that can be modified by the caller to
  5482. // add HTTP headers to the request.
  5483. func (c *ProjectsLocationsClustersSetMonitoringCall) Header() http.Header {
  5484. if c.header_ == nil {
  5485. c.header_ = make(http.Header)
  5486. }
  5487. return c.header_
  5488. }
  5489. func (c *ProjectsLocationsClustersSetMonitoringCall) doRequest(alt string) (*http.Response, error) {
  5490. reqHeaders := make(http.Header)
  5491. for k, v := range c.header_ {
  5492. reqHeaders[k] = v
  5493. }
  5494. reqHeaders.Set("User-Agent", c.s.userAgent())
  5495. var body io.Reader = nil
  5496. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmonitoringservicerequest)
  5497. if err != nil {
  5498. return nil, err
  5499. }
  5500. reqHeaders.Set("Content-Type", "application/json")
  5501. c.urlParams_.Set("alt", alt)
  5502. c.urlParams_.Set("prettyPrint", "false")
  5503. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMonitoring")
  5504. urls += "?" + c.urlParams_.Encode()
  5505. req, err := http.NewRequest("POST", urls, body)
  5506. if err != nil {
  5507. return nil, err
  5508. }
  5509. req.Header = reqHeaders
  5510. googleapi.Expand(req.URL, map[string]string{
  5511. "name": c.name,
  5512. })
  5513. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5514. }
  5515. // Do executes the "container.projects.locations.clusters.setMonitoring" call.
  5516. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5517. // status code is an error. Response headers are in either
  5518. // *Operation.ServerResponse.Header or (if a response was returned at
  5519. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5520. // to check whether the returned error was because
  5521. // http.StatusNotModified was returned.
  5522. func (c *ProjectsLocationsClustersSetMonitoringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5523. gensupport.SetOptions(c.urlParams_, opts...)
  5524. res, err := c.doRequest("json")
  5525. if res != nil && res.StatusCode == http.StatusNotModified {
  5526. if res.Body != nil {
  5527. res.Body.Close()
  5528. }
  5529. return nil, &googleapi.Error{
  5530. Code: res.StatusCode,
  5531. Header: res.Header,
  5532. }
  5533. }
  5534. if err != nil {
  5535. return nil, err
  5536. }
  5537. defer googleapi.CloseBody(res)
  5538. if err := googleapi.CheckResponse(res); err != nil {
  5539. return nil, err
  5540. }
  5541. ret := &Operation{
  5542. ServerResponse: googleapi.ServerResponse{
  5543. Header: res.Header,
  5544. HTTPStatusCode: res.StatusCode,
  5545. },
  5546. }
  5547. target := &ret
  5548. if err := gensupport.DecodeResponse(target, res); err != nil {
  5549. return nil, err
  5550. }
  5551. return ret, nil
  5552. // {
  5553. // "description": "Sets the monitoring service for a specific cluster.",
  5554. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMonitoring",
  5555. // "httpMethod": "POST",
  5556. // "id": "container.projects.locations.clusters.setMonitoring",
  5557. // "parameterOrder": [
  5558. // "name"
  5559. // ],
  5560. // "parameters": {
  5561. // "name": {
  5562. // "description": "The name (project, location, cluster) of the cluster to set monitoring.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5563. // "location": "path",
  5564. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5565. // "required": true,
  5566. // "type": "string"
  5567. // }
  5568. // },
  5569. // "path": "v1/{+name}:setMonitoring",
  5570. // "request": {
  5571. // "$ref": "SetMonitoringServiceRequest"
  5572. // },
  5573. // "response": {
  5574. // "$ref": "Operation"
  5575. // },
  5576. // "scopes": [
  5577. // "https://www.googleapis.com/auth/cloud-platform"
  5578. // ]
  5579. // }
  5580. }
  5581. // method id "container.projects.locations.clusters.setNetworkPolicy":
  5582. type ProjectsLocationsClustersSetNetworkPolicyCall struct {
  5583. s *Service
  5584. name string
  5585. setnetworkpolicyrequest *SetNetworkPolicyRequest
  5586. urlParams_ gensupport.URLParams
  5587. ctx_ context.Context
  5588. header_ http.Header
  5589. }
  5590. // SetNetworkPolicy: Enables or disables Network Policy for a cluster.
  5591. func (r *ProjectsLocationsClustersService) SetNetworkPolicy(name string, setnetworkpolicyrequest *SetNetworkPolicyRequest) *ProjectsLocationsClustersSetNetworkPolicyCall {
  5592. c := &ProjectsLocationsClustersSetNetworkPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5593. c.name = name
  5594. c.setnetworkpolicyrequest = setnetworkpolicyrequest
  5595. return c
  5596. }
  5597. // Fields allows partial responses to be retrieved. See
  5598. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5599. // for more information.
  5600. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetNetworkPolicyCall {
  5601. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5602. return c
  5603. }
  5604. // Context sets the context to be used in this call's Do method. Any
  5605. // pending HTTP request will be aborted if the provided context is
  5606. // canceled.
  5607. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Context(ctx context.Context) *ProjectsLocationsClustersSetNetworkPolicyCall {
  5608. c.ctx_ = ctx
  5609. return c
  5610. }
  5611. // Header returns an http.Header that can be modified by the caller to
  5612. // add HTTP headers to the request.
  5613. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Header() http.Header {
  5614. if c.header_ == nil {
  5615. c.header_ = make(http.Header)
  5616. }
  5617. return c.header_
  5618. }
  5619. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) doRequest(alt string) (*http.Response, error) {
  5620. reqHeaders := make(http.Header)
  5621. for k, v := range c.header_ {
  5622. reqHeaders[k] = v
  5623. }
  5624. reqHeaders.Set("User-Agent", c.s.userAgent())
  5625. var body io.Reader = nil
  5626. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnetworkpolicyrequest)
  5627. if err != nil {
  5628. return nil, err
  5629. }
  5630. reqHeaders.Set("Content-Type", "application/json")
  5631. c.urlParams_.Set("alt", alt)
  5632. c.urlParams_.Set("prettyPrint", "false")
  5633. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setNetworkPolicy")
  5634. urls += "?" + c.urlParams_.Encode()
  5635. req, err := http.NewRequest("POST", urls, body)
  5636. if err != nil {
  5637. return nil, err
  5638. }
  5639. req.Header = reqHeaders
  5640. googleapi.Expand(req.URL, map[string]string{
  5641. "name": c.name,
  5642. })
  5643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5644. }
  5645. // Do executes the "container.projects.locations.clusters.setNetworkPolicy" call.
  5646. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5647. // status code is an error. Response headers are in either
  5648. // *Operation.ServerResponse.Header or (if a response was returned at
  5649. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5650. // to check whether the returned error was because
  5651. // http.StatusNotModified was returned.
  5652. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5653. gensupport.SetOptions(c.urlParams_, opts...)
  5654. res, err := c.doRequest("json")
  5655. if res != nil && res.StatusCode == http.StatusNotModified {
  5656. if res.Body != nil {
  5657. res.Body.Close()
  5658. }
  5659. return nil, &googleapi.Error{
  5660. Code: res.StatusCode,
  5661. Header: res.Header,
  5662. }
  5663. }
  5664. if err != nil {
  5665. return nil, err
  5666. }
  5667. defer googleapi.CloseBody(res)
  5668. if err := googleapi.CheckResponse(res); err != nil {
  5669. return nil, err
  5670. }
  5671. ret := &Operation{
  5672. ServerResponse: googleapi.ServerResponse{
  5673. Header: res.Header,
  5674. HTTPStatusCode: res.StatusCode,
  5675. },
  5676. }
  5677. target := &ret
  5678. if err := gensupport.DecodeResponse(target, res); err != nil {
  5679. return nil, err
  5680. }
  5681. return ret, nil
  5682. // {
  5683. // "description": "Enables or disables Network Policy for a cluster.",
  5684. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setNetworkPolicy",
  5685. // "httpMethod": "POST",
  5686. // "id": "container.projects.locations.clusters.setNetworkPolicy",
  5687. // "parameterOrder": [
  5688. // "name"
  5689. // ],
  5690. // "parameters": {
  5691. // "name": {
  5692. // "description": "The name (project, location, cluster id) of the cluster to set networking\npolicy. Specified in the format 'projects/*/locations/*/clusters/*'.",
  5693. // "location": "path",
  5694. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5695. // "required": true,
  5696. // "type": "string"
  5697. // }
  5698. // },
  5699. // "path": "v1/{+name}:setNetworkPolicy",
  5700. // "request": {
  5701. // "$ref": "SetNetworkPolicyRequest"
  5702. // },
  5703. // "response": {
  5704. // "$ref": "Operation"
  5705. // },
  5706. // "scopes": [
  5707. // "https://www.googleapis.com/auth/cloud-platform"
  5708. // ]
  5709. // }
  5710. }
  5711. // method id "container.projects.locations.clusters.setResourceLabels":
  5712. type ProjectsLocationsClustersSetResourceLabelsCall struct {
  5713. s *Service
  5714. name string
  5715. setlabelsrequest *SetLabelsRequest
  5716. urlParams_ gensupport.URLParams
  5717. ctx_ context.Context
  5718. header_ http.Header
  5719. }
  5720. // SetResourceLabels: Sets labels on a cluster.
  5721. func (r *ProjectsLocationsClustersService) SetResourceLabels(name string, setlabelsrequest *SetLabelsRequest) *ProjectsLocationsClustersSetResourceLabelsCall {
  5722. c := &ProjectsLocationsClustersSetResourceLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5723. c.name = name
  5724. c.setlabelsrequest = setlabelsrequest
  5725. return c
  5726. }
  5727. // Fields allows partial responses to be retrieved. See
  5728. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5729. // for more information.
  5730. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetResourceLabelsCall {
  5731. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5732. return c
  5733. }
  5734. // Context sets the context to be used in this call's Do method. Any
  5735. // pending HTTP request will be aborted if the provided context is
  5736. // canceled.
  5737. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Context(ctx context.Context) *ProjectsLocationsClustersSetResourceLabelsCall {
  5738. c.ctx_ = ctx
  5739. return c
  5740. }
  5741. // Header returns an http.Header that can be modified by the caller to
  5742. // add HTTP headers to the request.
  5743. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Header() http.Header {
  5744. if c.header_ == nil {
  5745. c.header_ = make(http.Header)
  5746. }
  5747. return c.header_
  5748. }
  5749. func (c *ProjectsLocationsClustersSetResourceLabelsCall) doRequest(alt string) (*http.Response, error) {
  5750. reqHeaders := make(http.Header)
  5751. for k, v := range c.header_ {
  5752. reqHeaders[k] = v
  5753. }
  5754. reqHeaders.Set("User-Agent", c.s.userAgent())
  5755. var body io.Reader = nil
  5756. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlabelsrequest)
  5757. if err != nil {
  5758. return nil, err
  5759. }
  5760. reqHeaders.Set("Content-Type", "application/json")
  5761. c.urlParams_.Set("alt", alt)
  5762. c.urlParams_.Set("prettyPrint", "false")
  5763. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setResourceLabels")
  5764. urls += "?" + c.urlParams_.Encode()
  5765. req, err := http.NewRequest("POST", urls, body)
  5766. if err != nil {
  5767. return nil, err
  5768. }
  5769. req.Header = reqHeaders
  5770. googleapi.Expand(req.URL, map[string]string{
  5771. "name": c.name,
  5772. })
  5773. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5774. }
  5775. // Do executes the "container.projects.locations.clusters.setResourceLabels" call.
  5776. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5777. // status code is an error. Response headers are in either
  5778. // *Operation.ServerResponse.Header or (if a response was returned at
  5779. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5780. // to check whether the returned error was because
  5781. // http.StatusNotModified was returned.
  5782. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5783. gensupport.SetOptions(c.urlParams_, opts...)
  5784. res, err := c.doRequest("json")
  5785. if res != nil && res.StatusCode == http.StatusNotModified {
  5786. if res.Body != nil {
  5787. res.Body.Close()
  5788. }
  5789. return nil, &googleapi.Error{
  5790. Code: res.StatusCode,
  5791. Header: res.Header,
  5792. }
  5793. }
  5794. if err != nil {
  5795. return nil, err
  5796. }
  5797. defer googleapi.CloseBody(res)
  5798. if err := googleapi.CheckResponse(res); err != nil {
  5799. return nil, err
  5800. }
  5801. ret := &Operation{
  5802. ServerResponse: googleapi.ServerResponse{
  5803. Header: res.Header,
  5804. HTTPStatusCode: res.StatusCode,
  5805. },
  5806. }
  5807. target := &ret
  5808. if err := gensupport.DecodeResponse(target, res); err != nil {
  5809. return nil, err
  5810. }
  5811. return ret, nil
  5812. // {
  5813. // "description": "Sets labels on a cluster.",
  5814. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setResourceLabels",
  5815. // "httpMethod": "POST",
  5816. // "id": "container.projects.locations.clusters.setResourceLabels",
  5817. // "parameterOrder": [
  5818. // "name"
  5819. // ],
  5820. // "parameters": {
  5821. // "name": {
  5822. // "description": "The name (project, location, cluster id) of the cluster to set labels.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5823. // "location": "path",
  5824. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5825. // "required": true,
  5826. // "type": "string"
  5827. // }
  5828. // },
  5829. // "path": "v1/{+name}:setResourceLabels",
  5830. // "request": {
  5831. // "$ref": "SetLabelsRequest"
  5832. // },
  5833. // "response": {
  5834. // "$ref": "Operation"
  5835. // },
  5836. // "scopes": [
  5837. // "https://www.googleapis.com/auth/cloud-platform"
  5838. // ]
  5839. // }
  5840. }
  5841. // method id "container.projects.locations.clusters.startIpRotation":
  5842. type ProjectsLocationsClustersStartIpRotationCall struct {
  5843. s *Service
  5844. name string
  5845. startiprotationrequest *StartIPRotationRequest
  5846. urlParams_ gensupport.URLParams
  5847. ctx_ context.Context
  5848. header_ http.Header
  5849. }
  5850. // StartIpRotation: Starts master IP rotation.
  5851. func (r *ProjectsLocationsClustersService) StartIpRotation(name string, startiprotationrequest *StartIPRotationRequest) *ProjectsLocationsClustersStartIpRotationCall {
  5852. c := &ProjectsLocationsClustersStartIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5853. c.name = name
  5854. c.startiprotationrequest = startiprotationrequest
  5855. return c
  5856. }
  5857. // Fields allows partial responses to be retrieved. See
  5858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5859. // for more information.
  5860. func (c *ProjectsLocationsClustersStartIpRotationCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersStartIpRotationCall {
  5861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5862. return c
  5863. }
  5864. // Context sets the context to be used in this call's Do method. Any
  5865. // pending HTTP request will be aborted if the provided context is
  5866. // canceled.
  5867. func (c *ProjectsLocationsClustersStartIpRotationCall) Context(ctx context.Context) *ProjectsLocationsClustersStartIpRotationCall {
  5868. c.ctx_ = ctx
  5869. return c
  5870. }
  5871. // Header returns an http.Header that can be modified by the caller to
  5872. // add HTTP headers to the request.
  5873. func (c *ProjectsLocationsClustersStartIpRotationCall) Header() http.Header {
  5874. if c.header_ == nil {
  5875. c.header_ = make(http.Header)
  5876. }
  5877. return c.header_
  5878. }
  5879. func (c *ProjectsLocationsClustersStartIpRotationCall) doRequest(alt string) (*http.Response, error) {
  5880. reqHeaders := make(http.Header)
  5881. for k, v := range c.header_ {
  5882. reqHeaders[k] = v
  5883. }
  5884. reqHeaders.Set("User-Agent", c.s.userAgent())
  5885. var body io.Reader = nil
  5886. body, err := googleapi.WithoutDataWrapper.JSONReader(c.startiprotationrequest)
  5887. if err != nil {
  5888. return nil, err
  5889. }
  5890. reqHeaders.Set("Content-Type", "application/json")
  5891. c.urlParams_.Set("alt", alt)
  5892. c.urlParams_.Set("prettyPrint", "false")
  5893. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:startIpRotation")
  5894. urls += "?" + c.urlParams_.Encode()
  5895. req, err := http.NewRequest("POST", urls, body)
  5896. if err != nil {
  5897. return nil, err
  5898. }
  5899. req.Header = reqHeaders
  5900. googleapi.Expand(req.URL, map[string]string{
  5901. "name": c.name,
  5902. })
  5903. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5904. }
  5905. // Do executes the "container.projects.locations.clusters.startIpRotation" call.
  5906. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5907. // status code is an error. Response headers are in either
  5908. // *Operation.ServerResponse.Header or (if a response was returned at
  5909. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5910. // to check whether the returned error was because
  5911. // http.StatusNotModified was returned.
  5912. func (c *ProjectsLocationsClustersStartIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5913. gensupport.SetOptions(c.urlParams_, opts...)
  5914. res, err := c.doRequest("json")
  5915. if res != nil && res.StatusCode == http.StatusNotModified {
  5916. if res.Body != nil {
  5917. res.Body.Close()
  5918. }
  5919. return nil, &googleapi.Error{
  5920. Code: res.StatusCode,
  5921. Header: res.Header,
  5922. }
  5923. }
  5924. if err != nil {
  5925. return nil, err
  5926. }
  5927. defer googleapi.CloseBody(res)
  5928. if err := googleapi.CheckResponse(res); err != nil {
  5929. return nil, err
  5930. }
  5931. ret := &Operation{
  5932. ServerResponse: googleapi.ServerResponse{
  5933. Header: res.Header,
  5934. HTTPStatusCode: res.StatusCode,
  5935. },
  5936. }
  5937. target := &ret
  5938. if err := gensupport.DecodeResponse(target, res); err != nil {
  5939. return nil, err
  5940. }
  5941. return ret, nil
  5942. // {
  5943. // "description": "Starts master IP rotation.",
  5944. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:startIpRotation",
  5945. // "httpMethod": "POST",
  5946. // "id": "container.projects.locations.clusters.startIpRotation",
  5947. // "parameterOrder": [
  5948. // "name"
  5949. // ],
  5950. // "parameters": {
  5951. // "name": {
  5952. // "description": "The name (project, location, cluster id) of the cluster to start IP\nrotation. Specified in the format 'projects/*/locations/*/clusters/*'.",
  5953. // "location": "path",
  5954. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5955. // "required": true,
  5956. // "type": "string"
  5957. // }
  5958. // },
  5959. // "path": "v1/{+name}:startIpRotation",
  5960. // "request": {
  5961. // "$ref": "StartIPRotationRequest"
  5962. // },
  5963. // "response": {
  5964. // "$ref": "Operation"
  5965. // },
  5966. // "scopes": [
  5967. // "https://www.googleapis.com/auth/cloud-platform"
  5968. // ]
  5969. // }
  5970. }
  5971. // method id "container.projects.locations.clusters.update":
  5972. type ProjectsLocationsClustersUpdateCall struct {
  5973. s *Service
  5974. name string
  5975. updateclusterrequest *UpdateClusterRequest
  5976. urlParams_ gensupport.URLParams
  5977. ctx_ context.Context
  5978. header_ http.Header
  5979. }
  5980. // Update: Updates the settings of a specific cluster.
  5981. func (r *ProjectsLocationsClustersService) Update(name string, updateclusterrequest *UpdateClusterRequest) *ProjectsLocationsClustersUpdateCall {
  5982. c := &ProjectsLocationsClustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5983. c.name = name
  5984. c.updateclusterrequest = updateclusterrequest
  5985. return c
  5986. }
  5987. // Fields allows partial responses to be retrieved. See
  5988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5989. // for more information.
  5990. func (c *ProjectsLocationsClustersUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersUpdateCall {
  5991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5992. return c
  5993. }
  5994. // Context sets the context to be used in this call's Do method. Any
  5995. // pending HTTP request will be aborted if the provided context is
  5996. // canceled.
  5997. func (c *ProjectsLocationsClustersUpdateCall) Context(ctx context.Context) *ProjectsLocationsClustersUpdateCall {
  5998. c.ctx_ = ctx
  5999. return c
  6000. }
  6001. // Header returns an http.Header that can be modified by the caller to
  6002. // add HTTP headers to the request.
  6003. func (c *ProjectsLocationsClustersUpdateCall) Header() http.Header {
  6004. if c.header_ == nil {
  6005. c.header_ = make(http.Header)
  6006. }
  6007. return c.header_
  6008. }
  6009. func (c *ProjectsLocationsClustersUpdateCall) doRequest(alt string) (*http.Response, error) {
  6010. reqHeaders := make(http.Header)
  6011. for k, v := range c.header_ {
  6012. reqHeaders[k] = v
  6013. }
  6014. reqHeaders.Set("User-Agent", c.s.userAgent())
  6015. var body io.Reader = nil
  6016. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest)
  6017. if err != nil {
  6018. return nil, err
  6019. }
  6020. reqHeaders.Set("Content-Type", "application/json")
  6021. c.urlParams_.Set("alt", alt)
  6022. c.urlParams_.Set("prettyPrint", "false")
  6023. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6024. urls += "?" + c.urlParams_.Encode()
  6025. req, err := http.NewRequest("PUT", urls, body)
  6026. if err != nil {
  6027. return nil, err
  6028. }
  6029. req.Header = reqHeaders
  6030. googleapi.Expand(req.URL, map[string]string{
  6031. "name": c.name,
  6032. })
  6033. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6034. }
  6035. // Do executes the "container.projects.locations.clusters.update" call.
  6036. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6037. // status code is an error. Response headers are in either
  6038. // *Operation.ServerResponse.Header or (if a response was returned at
  6039. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6040. // to check whether the returned error was because
  6041. // http.StatusNotModified was returned.
  6042. func (c *ProjectsLocationsClustersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6043. gensupport.SetOptions(c.urlParams_, opts...)
  6044. res, err := c.doRequest("json")
  6045. if res != nil && res.StatusCode == http.StatusNotModified {
  6046. if res.Body != nil {
  6047. res.Body.Close()
  6048. }
  6049. return nil, &googleapi.Error{
  6050. Code: res.StatusCode,
  6051. Header: res.Header,
  6052. }
  6053. }
  6054. if err != nil {
  6055. return nil, err
  6056. }
  6057. defer googleapi.CloseBody(res)
  6058. if err := googleapi.CheckResponse(res); err != nil {
  6059. return nil, err
  6060. }
  6061. ret := &Operation{
  6062. ServerResponse: googleapi.ServerResponse{
  6063. Header: res.Header,
  6064. HTTPStatusCode: res.StatusCode,
  6065. },
  6066. }
  6067. target := &ret
  6068. if err := gensupport.DecodeResponse(target, res); err != nil {
  6069. return nil, err
  6070. }
  6071. return ret, nil
  6072. // {
  6073. // "description": "Updates the settings of a specific cluster.",
  6074. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
  6075. // "httpMethod": "PUT",
  6076. // "id": "container.projects.locations.clusters.update",
  6077. // "parameterOrder": [
  6078. // "name"
  6079. // ],
  6080. // "parameters": {
  6081. // "name": {
  6082. // "description": "The name (project, location, cluster) of the cluster to update.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  6083. // "location": "path",
  6084. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6085. // "required": true,
  6086. // "type": "string"
  6087. // }
  6088. // },
  6089. // "path": "v1/{+name}",
  6090. // "request": {
  6091. // "$ref": "UpdateClusterRequest"
  6092. // },
  6093. // "response": {
  6094. // "$ref": "Operation"
  6095. // },
  6096. // "scopes": [
  6097. // "https://www.googleapis.com/auth/cloud-platform"
  6098. // ]
  6099. // }
  6100. }
  6101. // method id "container.projects.locations.clusters.updateMaster":
  6102. type ProjectsLocationsClustersUpdateMasterCall struct {
  6103. s *Service
  6104. name string
  6105. updatemasterrequest *UpdateMasterRequest
  6106. urlParams_ gensupport.URLParams
  6107. ctx_ context.Context
  6108. header_ http.Header
  6109. }
  6110. // UpdateMaster: Updates the master for a specific cluster.
  6111. func (r *ProjectsLocationsClustersService) UpdateMaster(name string, updatemasterrequest *UpdateMasterRequest) *ProjectsLocationsClustersUpdateMasterCall {
  6112. c := &ProjectsLocationsClustersUpdateMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6113. c.name = name
  6114. c.updatemasterrequest = updatemasterrequest
  6115. return c
  6116. }
  6117. // Fields allows partial responses to be retrieved. See
  6118. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6119. // for more information.
  6120. func (c *ProjectsLocationsClustersUpdateMasterCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersUpdateMasterCall {
  6121. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6122. return c
  6123. }
  6124. // Context sets the context to be used in this call's Do method. Any
  6125. // pending HTTP request will be aborted if the provided context is
  6126. // canceled.
  6127. func (c *ProjectsLocationsClustersUpdateMasterCall) Context(ctx context.Context) *ProjectsLocationsClustersUpdateMasterCall {
  6128. c.ctx_ = ctx
  6129. return c
  6130. }
  6131. // Header returns an http.Header that can be modified by the caller to
  6132. // add HTTP headers to the request.
  6133. func (c *ProjectsLocationsClustersUpdateMasterCall) Header() http.Header {
  6134. if c.header_ == nil {
  6135. c.header_ = make(http.Header)
  6136. }
  6137. return c.header_
  6138. }
  6139. func (c *ProjectsLocationsClustersUpdateMasterCall) doRequest(alt string) (*http.Response, error) {
  6140. reqHeaders := make(http.Header)
  6141. for k, v := range c.header_ {
  6142. reqHeaders[k] = v
  6143. }
  6144. reqHeaders.Set("User-Agent", c.s.userAgent())
  6145. var body io.Reader = nil
  6146. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatemasterrequest)
  6147. if err != nil {
  6148. return nil, err
  6149. }
  6150. reqHeaders.Set("Content-Type", "application/json")
  6151. c.urlParams_.Set("alt", alt)
  6152. c.urlParams_.Set("prettyPrint", "false")
  6153. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:updateMaster")
  6154. urls += "?" + c.urlParams_.Encode()
  6155. req, err := http.NewRequest("POST", urls, body)
  6156. if err != nil {
  6157. return nil, err
  6158. }
  6159. req.Header = reqHeaders
  6160. googleapi.Expand(req.URL, map[string]string{
  6161. "name": c.name,
  6162. })
  6163. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6164. }
  6165. // Do executes the "container.projects.locations.clusters.updateMaster" call.
  6166. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6167. // status code is an error. Response headers are in either
  6168. // *Operation.ServerResponse.Header or (if a response was returned at
  6169. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6170. // to check whether the returned error was because
  6171. // http.StatusNotModified was returned.
  6172. func (c *ProjectsLocationsClustersUpdateMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6173. gensupport.SetOptions(c.urlParams_, opts...)
  6174. res, err := c.doRequest("json")
  6175. if res != nil && res.StatusCode == http.StatusNotModified {
  6176. if res.Body != nil {
  6177. res.Body.Close()
  6178. }
  6179. return nil, &googleapi.Error{
  6180. Code: res.StatusCode,
  6181. Header: res.Header,
  6182. }
  6183. }
  6184. if err != nil {
  6185. return nil, err
  6186. }
  6187. defer googleapi.CloseBody(res)
  6188. if err := googleapi.CheckResponse(res); err != nil {
  6189. return nil, err
  6190. }
  6191. ret := &Operation{
  6192. ServerResponse: googleapi.ServerResponse{
  6193. Header: res.Header,
  6194. HTTPStatusCode: res.StatusCode,
  6195. },
  6196. }
  6197. target := &ret
  6198. if err := gensupport.DecodeResponse(target, res); err != nil {
  6199. return nil, err
  6200. }
  6201. return ret, nil
  6202. // {
  6203. // "description": "Updates the master for a specific cluster.",
  6204. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:updateMaster",
  6205. // "httpMethod": "POST",
  6206. // "id": "container.projects.locations.clusters.updateMaster",
  6207. // "parameterOrder": [
  6208. // "name"
  6209. // ],
  6210. // "parameters": {
  6211. // "name": {
  6212. // "description": "The name (project, location, cluster) of the cluster to update.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  6213. // "location": "path",
  6214. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6215. // "required": true,
  6216. // "type": "string"
  6217. // }
  6218. // },
  6219. // "path": "v1/{+name}:updateMaster",
  6220. // "request": {
  6221. // "$ref": "UpdateMasterRequest"
  6222. // },
  6223. // "response": {
  6224. // "$ref": "Operation"
  6225. // },
  6226. // "scopes": [
  6227. // "https://www.googleapis.com/auth/cloud-platform"
  6228. // ]
  6229. // }
  6230. }
  6231. // method id "container.projects.locations.clusters.nodePools.create":
  6232. type ProjectsLocationsClustersNodePoolsCreateCall struct {
  6233. s *Service
  6234. parent string
  6235. createnodepoolrequest *CreateNodePoolRequest
  6236. urlParams_ gensupport.URLParams
  6237. ctx_ context.Context
  6238. header_ http.Header
  6239. }
  6240. // Create: Creates a node pool for a cluster.
  6241. func (r *ProjectsLocationsClustersNodePoolsService) Create(parent string, createnodepoolrequest *CreateNodePoolRequest) *ProjectsLocationsClustersNodePoolsCreateCall {
  6242. c := &ProjectsLocationsClustersNodePoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6243. c.parent = parent
  6244. c.createnodepoolrequest = createnodepoolrequest
  6245. return c
  6246. }
  6247. // Fields allows partial responses to be retrieved. See
  6248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6249. // for more information.
  6250. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsCreateCall {
  6251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6252. return c
  6253. }
  6254. // Context sets the context to be used in this call's Do method. Any
  6255. // pending HTTP request will be aborted if the provided context is
  6256. // canceled.
  6257. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsCreateCall {
  6258. c.ctx_ = ctx
  6259. return c
  6260. }
  6261. // Header returns an http.Header that can be modified by the caller to
  6262. // add HTTP headers to the request.
  6263. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Header() http.Header {
  6264. if c.header_ == nil {
  6265. c.header_ = make(http.Header)
  6266. }
  6267. return c.header_
  6268. }
  6269. func (c *ProjectsLocationsClustersNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) {
  6270. reqHeaders := make(http.Header)
  6271. for k, v := range c.header_ {
  6272. reqHeaders[k] = v
  6273. }
  6274. reqHeaders.Set("User-Agent", c.s.userAgent())
  6275. var body io.Reader = nil
  6276. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createnodepoolrequest)
  6277. if err != nil {
  6278. return nil, err
  6279. }
  6280. reqHeaders.Set("Content-Type", "application/json")
  6281. c.urlParams_.Set("alt", alt)
  6282. c.urlParams_.Set("prettyPrint", "false")
  6283. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/nodePools")
  6284. urls += "?" + c.urlParams_.Encode()
  6285. req, err := http.NewRequest("POST", urls, body)
  6286. if err != nil {
  6287. return nil, err
  6288. }
  6289. req.Header = reqHeaders
  6290. googleapi.Expand(req.URL, map[string]string{
  6291. "parent": c.parent,
  6292. })
  6293. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6294. }
  6295. // Do executes the "container.projects.locations.clusters.nodePools.create" call.
  6296. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6297. // status code is an error. Response headers are in either
  6298. // *Operation.ServerResponse.Header or (if a response was returned at
  6299. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6300. // to check whether the returned error was because
  6301. // http.StatusNotModified was returned.
  6302. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6303. gensupport.SetOptions(c.urlParams_, opts...)
  6304. res, err := c.doRequest("json")
  6305. if res != nil && res.StatusCode == http.StatusNotModified {
  6306. if res.Body != nil {
  6307. res.Body.Close()
  6308. }
  6309. return nil, &googleapi.Error{
  6310. Code: res.StatusCode,
  6311. Header: res.Header,
  6312. }
  6313. }
  6314. if err != nil {
  6315. return nil, err
  6316. }
  6317. defer googleapi.CloseBody(res)
  6318. if err := googleapi.CheckResponse(res); err != nil {
  6319. return nil, err
  6320. }
  6321. ret := &Operation{
  6322. ServerResponse: googleapi.ServerResponse{
  6323. Header: res.Header,
  6324. HTTPStatusCode: res.StatusCode,
  6325. },
  6326. }
  6327. target := &ret
  6328. if err := gensupport.DecodeResponse(target, res); err != nil {
  6329. return nil, err
  6330. }
  6331. return ret, nil
  6332. // {
  6333. // "description": "Creates a node pool for a cluster.",
  6334. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools",
  6335. // "httpMethod": "POST",
  6336. // "id": "container.projects.locations.clusters.nodePools.create",
  6337. // "parameterOrder": [
  6338. // "parent"
  6339. // ],
  6340. // "parameters": {
  6341. // "parent": {
  6342. // "description": "The parent (project, location, cluster id) where the node pool will be\ncreated. Specified in the format\n'projects/*/locations/*/clusters/*'.",
  6343. // "location": "path",
  6344. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6345. // "required": true,
  6346. // "type": "string"
  6347. // }
  6348. // },
  6349. // "path": "v1/{+parent}/nodePools",
  6350. // "request": {
  6351. // "$ref": "CreateNodePoolRequest"
  6352. // },
  6353. // "response": {
  6354. // "$ref": "Operation"
  6355. // },
  6356. // "scopes": [
  6357. // "https://www.googleapis.com/auth/cloud-platform"
  6358. // ]
  6359. // }
  6360. }
  6361. // method id "container.projects.locations.clusters.nodePools.delete":
  6362. type ProjectsLocationsClustersNodePoolsDeleteCall struct {
  6363. s *Service
  6364. name string
  6365. urlParams_ gensupport.URLParams
  6366. ctx_ context.Context
  6367. header_ http.Header
  6368. }
  6369. // Delete: Deletes a node pool from a cluster.
  6370. func (r *ProjectsLocationsClustersNodePoolsService) Delete(name string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  6371. c := &ProjectsLocationsClustersNodePoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6372. c.name = name
  6373. return c
  6374. }
  6375. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  6376. // name of the cluster.
  6377. // This field has been deprecated and replaced by the name field.
  6378. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) ClusterId(clusterId string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  6379. c.urlParams_.Set("clusterId", clusterId)
  6380. return c
  6381. }
  6382. // NodePoolId sets the optional parameter "nodePoolId": Deprecated. The
  6383. // name of the node pool to delete.
  6384. // This field has been deprecated and replaced by the name field.
  6385. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) NodePoolId(nodePoolId string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  6386. c.urlParams_.Set("nodePoolId", nodePoolId)
  6387. return c
  6388. }
  6389. // ProjectId sets the optional parameter "projectId": Deprecated. The
  6390. // Google Developers Console [project ID or
  6391. // project
  6392. // number](https://developers.google.com/console/help/new/#projec
  6393. // tnumber).
  6394. // This field has been deprecated and replaced by the name field.
  6395. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) ProjectId(projectId string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  6396. c.urlParams_.Set("projectId", projectId)
  6397. return c
  6398. }
  6399. // Zone sets the optional parameter "zone": Deprecated. The name of the
  6400. // Google Compute Engine
  6401. // [zone](/compute/docs/zones#available) in which the
  6402. // cluster
  6403. // resides.
  6404. // This field has been deprecated and replaced by the name field.
  6405. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Zone(zone string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  6406. c.urlParams_.Set("zone", zone)
  6407. return c
  6408. }
  6409. // Fields allows partial responses to be retrieved. See
  6410. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6411. // for more information.
  6412. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsDeleteCall {
  6413. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6414. return c
  6415. }
  6416. // Context sets the context to be used in this call's Do method. Any
  6417. // pending HTTP request will be aborted if the provided context is
  6418. // canceled.
  6419. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsDeleteCall {
  6420. c.ctx_ = ctx
  6421. return c
  6422. }
  6423. // Header returns an http.Header that can be modified by the caller to
  6424. // add HTTP headers to the request.
  6425. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Header() http.Header {
  6426. if c.header_ == nil {
  6427. c.header_ = make(http.Header)
  6428. }
  6429. return c.header_
  6430. }
  6431. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6432. reqHeaders := make(http.Header)
  6433. for k, v := range c.header_ {
  6434. reqHeaders[k] = v
  6435. }
  6436. reqHeaders.Set("User-Agent", c.s.userAgent())
  6437. var body io.Reader = nil
  6438. c.urlParams_.Set("alt", alt)
  6439. c.urlParams_.Set("prettyPrint", "false")
  6440. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6441. urls += "?" + c.urlParams_.Encode()
  6442. req, err := http.NewRequest("DELETE", urls, body)
  6443. if err != nil {
  6444. return nil, err
  6445. }
  6446. req.Header = reqHeaders
  6447. googleapi.Expand(req.URL, map[string]string{
  6448. "name": c.name,
  6449. })
  6450. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6451. }
  6452. // Do executes the "container.projects.locations.clusters.nodePools.delete" call.
  6453. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6454. // status code is an error. Response headers are in either
  6455. // *Operation.ServerResponse.Header or (if a response was returned at
  6456. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6457. // to check whether the returned error was because
  6458. // http.StatusNotModified was returned.
  6459. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6460. gensupport.SetOptions(c.urlParams_, opts...)
  6461. res, err := c.doRequest("json")
  6462. if res != nil && res.StatusCode == http.StatusNotModified {
  6463. if res.Body != nil {
  6464. res.Body.Close()
  6465. }
  6466. return nil, &googleapi.Error{
  6467. Code: res.StatusCode,
  6468. Header: res.Header,
  6469. }
  6470. }
  6471. if err != nil {
  6472. return nil, err
  6473. }
  6474. defer googleapi.CloseBody(res)
  6475. if err := googleapi.CheckResponse(res); err != nil {
  6476. return nil, err
  6477. }
  6478. ret := &Operation{
  6479. ServerResponse: googleapi.ServerResponse{
  6480. Header: res.Header,
  6481. HTTPStatusCode: res.StatusCode,
  6482. },
  6483. }
  6484. target := &ret
  6485. if err := gensupport.DecodeResponse(target, res); err != nil {
  6486. return nil, err
  6487. }
  6488. return ret, nil
  6489. // {
  6490. // "description": "Deletes a node pool from a cluster.",
  6491. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
  6492. // "httpMethod": "DELETE",
  6493. // "id": "container.projects.locations.clusters.nodePools.delete",
  6494. // "parameterOrder": [
  6495. // "name"
  6496. // ],
  6497. // "parameters": {
  6498. // "clusterId": {
  6499. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  6500. // "location": "query",
  6501. // "type": "string"
  6502. // },
  6503. // "name": {
  6504. // "description": "The name (project, location, cluster, node pool id) of the node pool to\ndelete. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  6505. // "location": "path",
  6506. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6507. // "required": true,
  6508. // "type": "string"
  6509. // },
  6510. // "nodePoolId": {
  6511. // "description": "Deprecated. The name of the node pool to delete.\nThis field has been deprecated and replaced by the name field.",
  6512. // "location": "query",
  6513. // "type": "string"
  6514. // },
  6515. // "projectId": {
  6516. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  6517. // "location": "query",
  6518. // "type": "string"
  6519. // },
  6520. // "zone": {
  6521. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  6522. // "location": "query",
  6523. // "type": "string"
  6524. // }
  6525. // },
  6526. // "path": "v1/{+name}",
  6527. // "response": {
  6528. // "$ref": "Operation"
  6529. // },
  6530. // "scopes": [
  6531. // "https://www.googleapis.com/auth/cloud-platform"
  6532. // ]
  6533. // }
  6534. }
  6535. // method id "container.projects.locations.clusters.nodePools.get":
  6536. type ProjectsLocationsClustersNodePoolsGetCall struct {
  6537. s *Service
  6538. name string
  6539. urlParams_ gensupport.URLParams
  6540. ifNoneMatch_ string
  6541. ctx_ context.Context
  6542. header_ http.Header
  6543. }
  6544. // Get: Retrieves the requested node pool.
  6545. func (r *ProjectsLocationsClustersNodePoolsService) Get(name string) *ProjectsLocationsClustersNodePoolsGetCall {
  6546. c := &ProjectsLocationsClustersNodePoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6547. c.name = name
  6548. return c
  6549. }
  6550. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  6551. // name of the cluster.
  6552. // This field has been deprecated and replaced by the name field.
  6553. func (c *ProjectsLocationsClustersNodePoolsGetCall) ClusterId(clusterId string) *ProjectsLocationsClustersNodePoolsGetCall {
  6554. c.urlParams_.Set("clusterId", clusterId)
  6555. return c
  6556. }
  6557. // NodePoolId sets the optional parameter "nodePoolId": Deprecated. The
  6558. // name of the node pool.
  6559. // This field has been deprecated and replaced by the name field.
  6560. func (c *ProjectsLocationsClustersNodePoolsGetCall) NodePoolId(nodePoolId string) *ProjectsLocationsClustersNodePoolsGetCall {
  6561. c.urlParams_.Set("nodePoolId", nodePoolId)
  6562. return c
  6563. }
  6564. // ProjectId sets the optional parameter "projectId": Deprecated. The
  6565. // Google Developers Console [project ID or
  6566. // project
  6567. // number](https://developers.google.com/console/help/new/#projec
  6568. // tnumber).
  6569. // This field has been deprecated and replaced by the name field.
  6570. func (c *ProjectsLocationsClustersNodePoolsGetCall) ProjectId(projectId string) *ProjectsLocationsClustersNodePoolsGetCall {
  6571. c.urlParams_.Set("projectId", projectId)
  6572. return c
  6573. }
  6574. // Zone sets the optional parameter "zone": Deprecated. The name of the
  6575. // Google Compute Engine
  6576. // [zone](/compute/docs/zones#available) in which the
  6577. // cluster
  6578. // resides.
  6579. // This field has been deprecated and replaced by the name field.
  6580. func (c *ProjectsLocationsClustersNodePoolsGetCall) Zone(zone string) *ProjectsLocationsClustersNodePoolsGetCall {
  6581. c.urlParams_.Set("zone", zone)
  6582. return c
  6583. }
  6584. // Fields allows partial responses to be retrieved. See
  6585. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6586. // for more information.
  6587. func (c *ProjectsLocationsClustersNodePoolsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsGetCall {
  6588. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6589. return c
  6590. }
  6591. // IfNoneMatch sets the optional parameter which makes the operation
  6592. // fail if the object's ETag matches the given value. This is useful for
  6593. // getting updates only after the object has changed since the last
  6594. // request. Use googleapi.IsNotModified to check whether the response
  6595. // error from Do is the result of In-None-Match.
  6596. func (c *ProjectsLocationsClustersNodePoolsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersNodePoolsGetCall {
  6597. c.ifNoneMatch_ = entityTag
  6598. return c
  6599. }
  6600. // Context sets the context to be used in this call's Do method. Any
  6601. // pending HTTP request will be aborted if the provided context is
  6602. // canceled.
  6603. func (c *ProjectsLocationsClustersNodePoolsGetCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsGetCall {
  6604. c.ctx_ = ctx
  6605. return c
  6606. }
  6607. // Header returns an http.Header that can be modified by the caller to
  6608. // add HTTP headers to the request.
  6609. func (c *ProjectsLocationsClustersNodePoolsGetCall) Header() http.Header {
  6610. if c.header_ == nil {
  6611. c.header_ = make(http.Header)
  6612. }
  6613. return c.header_
  6614. }
  6615. func (c *ProjectsLocationsClustersNodePoolsGetCall) doRequest(alt string) (*http.Response, error) {
  6616. reqHeaders := make(http.Header)
  6617. for k, v := range c.header_ {
  6618. reqHeaders[k] = v
  6619. }
  6620. reqHeaders.Set("User-Agent", c.s.userAgent())
  6621. if c.ifNoneMatch_ != "" {
  6622. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6623. }
  6624. var body io.Reader = nil
  6625. c.urlParams_.Set("alt", alt)
  6626. c.urlParams_.Set("prettyPrint", "false")
  6627. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6628. urls += "?" + c.urlParams_.Encode()
  6629. req, err := http.NewRequest("GET", urls, body)
  6630. if err != nil {
  6631. return nil, err
  6632. }
  6633. req.Header = reqHeaders
  6634. googleapi.Expand(req.URL, map[string]string{
  6635. "name": c.name,
  6636. })
  6637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6638. }
  6639. // Do executes the "container.projects.locations.clusters.nodePools.get" call.
  6640. // Exactly one of *NodePool or error will be non-nil. Any non-2xx status
  6641. // code is an error. Response headers are in either
  6642. // *NodePool.ServerResponse.Header or (if a response was returned at
  6643. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6644. // to check whether the returned error was because
  6645. // http.StatusNotModified was returned.
  6646. func (c *ProjectsLocationsClustersNodePoolsGetCall) Do(opts ...googleapi.CallOption) (*NodePool, error) {
  6647. gensupport.SetOptions(c.urlParams_, opts...)
  6648. res, err := c.doRequest("json")
  6649. if res != nil && res.StatusCode == http.StatusNotModified {
  6650. if res.Body != nil {
  6651. res.Body.Close()
  6652. }
  6653. return nil, &googleapi.Error{
  6654. Code: res.StatusCode,
  6655. Header: res.Header,
  6656. }
  6657. }
  6658. if err != nil {
  6659. return nil, err
  6660. }
  6661. defer googleapi.CloseBody(res)
  6662. if err := googleapi.CheckResponse(res); err != nil {
  6663. return nil, err
  6664. }
  6665. ret := &NodePool{
  6666. ServerResponse: googleapi.ServerResponse{
  6667. Header: res.Header,
  6668. HTTPStatusCode: res.StatusCode,
  6669. },
  6670. }
  6671. target := &ret
  6672. if err := gensupport.DecodeResponse(target, res); err != nil {
  6673. return nil, err
  6674. }
  6675. return ret, nil
  6676. // {
  6677. // "description": "Retrieves the requested node pool.",
  6678. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
  6679. // "httpMethod": "GET",
  6680. // "id": "container.projects.locations.clusters.nodePools.get",
  6681. // "parameterOrder": [
  6682. // "name"
  6683. // ],
  6684. // "parameters": {
  6685. // "clusterId": {
  6686. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  6687. // "location": "query",
  6688. // "type": "string"
  6689. // },
  6690. // "name": {
  6691. // "description": "The name (project, location, cluster, node pool id) of the node pool to\nget. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  6692. // "location": "path",
  6693. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6694. // "required": true,
  6695. // "type": "string"
  6696. // },
  6697. // "nodePoolId": {
  6698. // "description": "Deprecated. The name of the node pool.\nThis field has been deprecated and replaced by the name field.",
  6699. // "location": "query",
  6700. // "type": "string"
  6701. // },
  6702. // "projectId": {
  6703. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  6704. // "location": "query",
  6705. // "type": "string"
  6706. // },
  6707. // "zone": {
  6708. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  6709. // "location": "query",
  6710. // "type": "string"
  6711. // }
  6712. // },
  6713. // "path": "v1/{+name}",
  6714. // "response": {
  6715. // "$ref": "NodePool"
  6716. // },
  6717. // "scopes": [
  6718. // "https://www.googleapis.com/auth/cloud-platform"
  6719. // ]
  6720. // }
  6721. }
  6722. // method id "container.projects.locations.clusters.nodePools.list":
  6723. type ProjectsLocationsClustersNodePoolsListCall struct {
  6724. s *Service
  6725. parent string
  6726. urlParams_ gensupport.URLParams
  6727. ifNoneMatch_ string
  6728. ctx_ context.Context
  6729. header_ http.Header
  6730. }
  6731. // List: Lists the node pools for a cluster.
  6732. func (r *ProjectsLocationsClustersNodePoolsService) List(parent string) *ProjectsLocationsClustersNodePoolsListCall {
  6733. c := &ProjectsLocationsClustersNodePoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6734. c.parent = parent
  6735. return c
  6736. }
  6737. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  6738. // name of the cluster.
  6739. // This field has been deprecated and replaced by the parent field.
  6740. func (c *ProjectsLocationsClustersNodePoolsListCall) ClusterId(clusterId string) *ProjectsLocationsClustersNodePoolsListCall {
  6741. c.urlParams_.Set("clusterId", clusterId)
  6742. return c
  6743. }
  6744. // ProjectId sets the optional parameter "projectId": Deprecated. The
  6745. // Google Developers Console [project ID or
  6746. // project
  6747. // number](https://developers.google.com/console/help/new/#projec
  6748. // tnumber).
  6749. // This field has been deprecated and replaced by the parent field.
  6750. func (c *ProjectsLocationsClustersNodePoolsListCall) ProjectId(projectId string) *ProjectsLocationsClustersNodePoolsListCall {
  6751. c.urlParams_.Set("projectId", projectId)
  6752. return c
  6753. }
  6754. // Zone sets the optional parameter "zone": Deprecated. The name of the
  6755. // Google Compute Engine
  6756. // [zone](/compute/docs/zones#available) in which the
  6757. // cluster
  6758. // resides.
  6759. // This field has been deprecated and replaced by the parent field.
  6760. func (c *ProjectsLocationsClustersNodePoolsListCall) Zone(zone string) *ProjectsLocationsClustersNodePoolsListCall {
  6761. c.urlParams_.Set("zone", zone)
  6762. return c
  6763. }
  6764. // Fields allows partial responses to be retrieved. See
  6765. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6766. // for more information.
  6767. func (c *ProjectsLocationsClustersNodePoolsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsListCall {
  6768. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6769. return c
  6770. }
  6771. // IfNoneMatch sets the optional parameter which makes the operation
  6772. // fail if the object's ETag matches the given value. This is useful for
  6773. // getting updates only after the object has changed since the last
  6774. // request. Use googleapi.IsNotModified to check whether the response
  6775. // error from Do is the result of In-None-Match.
  6776. func (c *ProjectsLocationsClustersNodePoolsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersNodePoolsListCall {
  6777. c.ifNoneMatch_ = entityTag
  6778. return c
  6779. }
  6780. // Context sets the context to be used in this call's Do method. Any
  6781. // pending HTTP request will be aborted if the provided context is
  6782. // canceled.
  6783. func (c *ProjectsLocationsClustersNodePoolsListCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsListCall {
  6784. c.ctx_ = ctx
  6785. return c
  6786. }
  6787. // Header returns an http.Header that can be modified by the caller to
  6788. // add HTTP headers to the request.
  6789. func (c *ProjectsLocationsClustersNodePoolsListCall) Header() http.Header {
  6790. if c.header_ == nil {
  6791. c.header_ = make(http.Header)
  6792. }
  6793. return c.header_
  6794. }
  6795. func (c *ProjectsLocationsClustersNodePoolsListCall) doRequest(alt string) (*http.Response, error) {
  6796. reqHeaders := make(http.Header)
  6797. for k, v := range c.header_ {
  6798. reqHeaders[k] = v
  6799. }
  6800. reqHeaders.Set("User-Agent", c.s.userAgent())
  6801. if c.ifNoneMatch_ != "" {
  6802. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6803. }
  6804. var body io.Reader = nil
  6805. c.urlParams_.Set("alt", alt)
  6806. c.urlParams_.Set("prettyPrint", "false")
  6807. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/nodePools")
  6808. urls += "?" + c.urlParams_.Encode()
  6809. req, err := http.NewRequest("GET", urls, body)
  6810. if err != nil {
  6811. return nil, err
  6812. }
  6813. req.Header = reqHeaders
  6814. googleapi.Expand(req.URL, map[string]string{
  6815. "parent": c.parent,
  6816. })
  6817. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6818. }
  6819. // Do executes the "container.projects.locations.clusters.nodePools.list" call.
  6820. // Exactly one of *ListNodePoolsResponse or error will be non-nil. Any
  6821. // non-2xx status code is an error. Response headers are in either
  6822. // *ListNodePoolsResponse.ServerResponse.Header or (if a response was
  6823. // returned at all) in error.(*googleapi.Error).Header. Use
  6824. // googleapi.IsNotModified to check whether the returned error was
  6825. // because http.StatusNotModified was returned.
  6826. func (c *ProjectsLocationsClustersNodePoolsListCall) Do(opts ...googleapi.CallOption) (*ListNodePoolsResponse, error) {
  6827. gensupport.SetOptions(c.urlParams_, opts...)
  6828. res, err := c.doRequest("json")
  6829. if res != nil && res.StatusCode == http.StatusNotModified {
  6830. if res.Body != nil {
  6831. res.Body.Close()
  6832. }
  6833. return nil, &googleapi.Error{
  6834. Code: res.StatusCode,
  6835. Header: res.Header,
  6836. }
  6837. }
  6838. if err != nil {
  6839. return nil, err
  6840. }
  6841. defer googleapi.CloseBody(res)
  6842. if err := googleapi.CheckResponse(res); err != nil {
  6843. return nil, err
  6844. }
  6845. ret := &ListNodePoolsResponse{
  6846. ServerResponse: googleapi.ServerResponse{
  6847. Header: res.Header,
  6848. HTTPStatusCode: res.StatusCode,
  6849. },
  6850. }
  6851. target := &ret
  6852. if err := gensupport.DecodeResponse(target, res); err != nil {
  6853. return nil, err
  6854. }
  6855. return ret, nil
  6856. // {
  6857. // "description": "Lists the node pools for a cluster.",
  6858. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools",
  6859. // "httpMethod": "GET",
  6860. // "id": "container.projects.locations.clusters.nodePools.list",
  6861. // "parameterOrder": [
  6862. // "parent"
  6863. // ],
  6864. // "parameters": {
  6865. // "clusterId": {
  6866. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the parent field.",
  6867. // "location": "query",
  6868. // "type": "string"
  6869. // },
  6870. // "parent": {
  6871. // "description": "The parent (project, location, cluster id) where the node pools will be\nlisted. Specified in the format 'projects/*/locations/*/clusters/*'.",
  6872. // "location": "path",
  6873. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6874. // "required": true,
  6875. // "type": "string"
  6876. // },
  6877. // "projectId": {
  6878. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the parent field.",
  6879. // "location": "query",
  6880. // "type": "string"
  6881. // },
  6882. // "zone": {
  6883. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the parent field.",
  6884. // "location": "query",
  6885. // "type": "string"
  6886. // }
  6887. // },
  6888. // "path": "v1/{+parent}/nodePools",
  6889. // "response": {
  6890. // "$ref": "ListNodePoolsResponse"
  6891. // },
  6892. // "scopes": [
  6893. // "https://www.googleapis.com/auth/cloud-platform"
  6894. // ]
  6895. // }
  6896. }
  6897. // method id "container.projects.locations.clusters.nodePools.rollback":
  6898. type ProjectsLocationsClustersNodePoolsRollbackCall struct {
  6899. s *Service
  6900. name string
  6901. rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest
  6902. urlParams_ gensupport.URLParams
  6903. ctx_ context.Context
  6904. header_ http.Header
  6905. }
  6906. // Rollback: Rolls back a previously Aborted or Failed NodePool
  6907. // upgrade.
  6908. // This makes no changes if the last upgrade successfully completed.
  6909. func (r *ProjectsLocationsClustersNodePoolsService) Rollback(name string, rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest) *ProjectsLocationsClustersNodePoolsRollbackCall {
  6910. c := &ProjectsLocationsClustersNodePoolsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6911. c.name = name
  6912. c.rollbacknodepoolupgraderequest = rollbacknodepoolupgraderequest
  6913. return c
  6914. }
  6915. // Fields allows partial responses to be retrieved. See
  6916. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6917. // for more information.
  6918. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsRollbackCall {
  6919. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6920. return c
  6921. }
  6922. // Context sets the context to be used in this call's Do method. Any
  6923. // pending HTTP request will be aborted if the provided context is
  6924. // canceled.
  6925. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsRollbackCall {
  6926. c.ctx_ = ctx
  6927. return c
  6928. }
  6929. // Header returns an http.Header that can be modified by the caller to
  6930. // add HTTP headers to the request.
  6931. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Header() http.Header {
  6932. if c.header_ == nil {
  6933. c.header_ = make(http.Header)
  6934. }
  6935. return c.header_
  6936. }
  6937. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) doRequest(alt string) (*http.Response, error) {
  6938. reqHeaders := make(http.Header)
  6939. for k, v := range c.header_ {
  6940. reqHeaders[k] = v
  6941. }
  6942. reqHeaders.Set("User-Agent", c.s.userAgent())
  6943. var body io.Reader = nil
  6944. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbacknodepoolupgraderequest)
  6945. if err != nil {
  6946. return nil, err
  6947. }
  6948. reqHeaders.Set("Content-Type", "application/json")
  6949. c.urlParams_.Set("alt", alt)
  6950. c.urlParams_.Set("prettyPrint", "false")
  6951. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:rollback")
  6952. urls += "?" + c.urlParams_.Encode()
  6953. req, err := http.NewRequest("POST", urls, body)
  6954. if err != nil {
  6955. return nil, err
  6956. }
  6957. req.Header = reqHeaders
  6958. googleapi.Expand(req.URL, map[string]string{
  6959. "name": c.name,
  6960. })
  6961. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6962. }
  6963. // Do executes the "container.projects.locations.clusters.nodePools.rollback" call.
  6964. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6965. // status code is an error. Response headers are in either
  6966. // *Operation.ServerResponse.Header or (if a response was returned at
  6967. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6968. // to check whether the returned error was because
  6969. // http.StatusNotModified was returned.
  6970. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6971. gensupport.SetOptions(c.urlParams_, opts...)
  6972. res, err := c.doRequest("json")
  6973. if res != nil && res.StatusCode == http.StatusNotModified {
  6974. if res.Body != nil {
  6975. res.Body.Close()
  6976. }
  6977. return nil, &googleapi.Error{
  6978. Code: res.StatusCode,
  6979. Header: res.Header,
  6980. }
  6981. }
  6982. if err != nil {
  6983. return nil, err
  6984. }
  6985. defer googleapi.CloseBody(res)
  6986. if err := googleapi.CheckResponse(res); err != nil {
  6987. return nil, err
  6988. }
  6989. ret := &Operation{
  6990. ServerResponse: googleapi.ServerResponse{
  6991. Header: res.Header,
  6992. HTTPStatusCode: res.StatusCode,
  6993. },
  6994. }
  6995. target := &ret
  6996. if err := gensupport.DecodeResponse(target, res); err != nil {
  6997. return nil, err
  6998. }
  6999. return ret, nil
  7000. // {
  7001. // "description": "Rolls back a previously Aborted or Failed NodePool upgrade.\nThis makes no changes if the last upgrade successfully completed.",
  7002. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:rollback",
  7003. // "httpMethod": "POST",
  7004. // "id": "container.projects.locations.clusters.nodePools.rollback",
  7005. // "parameterOrder": [
  7006. // "name"
  7007. // ],
  7008. // "parameters": {
  7009. // "name": {
  7010. // "description": "The name (project, location, cluster, node pool id) of the node poll to\nrollback upgrade.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.",
  7011. // "location": "path",
  7012. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  7013. // "required": true,
  7014. // "type": "string"
  7015. // }
  7016. // },
  7017. // "path": "v1/{+name}:rollback",
  7018. // "request": {
  7019. // "$ref": "RollbackNodePoolUpgradeRequest"
  7020. // },
  7021. // "response": {
  7022. // "$ref": "Operation"
  7023. // },
  7024. // "scopes": [
  7025. // "https://www.googleapis.com/auth/cloud-platform"
  7026. // ]
  7027. // }
  7028. }
  7029. // method id "container.projects.locations.clusters.nodePools.setAutoscaling":
  7030. type ProjectsLocationsClustersNodePoolsSetAutoscalingCall struct {
  7031. s *Service
  7032. name string
  7033. setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest
  7034. urlParams_ gensupport.URLParams
  7035. ctx_ context.Context
  7036. header_ http.Header
  7037. }
  7038. // SetAutoscaling: Sets the autoscaling settings for the specified node
  7039. // pool.
  7040. func (r *ProjectsLocationsClustersNodePoolsService) SetAutoscaling(name string, setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest) *ProjectsLocationsClustersNodePoolsSetAutoscalingCall {
  7041. c := &ProjectsLocationsClustersNodePoolsSetAutoscalingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7042. c.name = name
  7043. c.setnodepoolautoscalingrequest = setnodepoolautoscalingrequest
  7044. return c
  7045. }
  7046. // Fields allows partial responses to be retrieved. See
  7047. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7048. // for more information.
  7049. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsSetAutoscalingCall {
  7050. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7051. return c
  7052. }
  7053. // Context sets the context to be used in this call's Do method. Any
  7054. // pending HTTP request will be aborted if the provided context is
  7055. // canceled.
  7056. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsSetAutoscalingCall {
  7057. c.ctx_ = ctx
  7058. return c
  7059. }
  7060. // Header returns an http.Header that can be modified by the caller to
  7061. // add HTTP headers to the request.
  7062. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Header() http.Header {
  7063. if c.header_ == nil {
  7064. c.header_ = make(http.Header)
  7065. }
  7066. return c.header_
  7067. }
  7068. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) doRequest(alt string) (*http.Response, error) {
  7069. reqHeaders := make(http.Header)
  7070. for k, v := range c.header_ {
  7071. reqHeaders[k] = v
  7072. }
  7073. reqHeaders.Set("User-Agent", c.s.userAgent())
  7074. var body io.Reader = nil
  7075. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolautoscalingrequest)
  7076. if err != nil {
  7077. return nil, err
  7078. }
  7079. reqHeaders.Set("Content-Type", "application/json")
  7080. c.urlParams_.Set("alt", alt)
  7081. c.urlParams_.Set("prettyPrint", "false")
  7082. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setAutoscaling")
  7083. urls += "?" + c.urlParams_.Encode()
  7084. req, err := http.NewRequest("POST", urls, body)
  7085. if err != nil {
  7086. return nil, err
  7087. }
  7088. req.Header = reqHeaders
  7089. googleapi.Expand(req.URL, map[string]string{
  7090. "name": c.name,
  7091. })
  7092. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7093. }
  7094. // Do executes the "container.projects.locations.clusters.nodePools.setAutoscaling" call.
  7095. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7096. // status code is an error. Response headers are in either
  7097. // *Operation.ServerResponse.Header or (if a response was returned at
  7098. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7099. // to check whether the returned error was because
  7100. // http.StatusNotModified was returned.
  7101. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7102. gensupport.SetOptions(c.urlParams_, opts...)
  7103. res, err := c.doRequest("json")
  7104. if res != nil && res.StatusCode == http.StatusNotModified {
  7105. if res.Body != nil {
  7106. res.Body.Close()
  7107. }
  7108. return nil, &googleapi.Error{
  7109. Code: res.StatusCode,
  7110. Header: res.Header,
  7111. }
  7112. }
  7113. if err != nil {
  7114. return nil, err
  7115. }
  7116. defer googleapi.CloseBody(res)
  7117. if err := googleapi.CheckResponse(res); err != nil {
  7118. return nil, err
  7119. }
  7120. ret := &Operation{
  7121. ServerResponse: googleapi.ServerResponse{
  7122. Header: res.Header,
  7123. HTTPStatusCode: res.StatusCode,
  7124. },
  7125. }
  7126. target := &ret
  7127. if err := gensupport.DecodeResponse(target, res); err != nil {
  7128. return nil, err
  7129. }
  7130. return ret, nil
  7131. // {
  7132. // "description": "Sets the autoscaling settings for the specified node pool.",
  7133. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setAutoscaling",
  7134. // "httpMethod": "POST",
  7135. // "id": "container.projects.locations.clusters.nodePools.setAutoscaling",
  7136. // "parameterOrder": [
  7137. // "name"
  7138. // ],
  7139. // "parameters": {
  7140. // "name": {
  7141. // "description": "The name (project, location, cluster, node pool) of the node pool to set\nautoscaler settings. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  7142. // "location": "path",
  7143. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  7144. // "required": true,
  7145. // "type": "string"
  7146. // }
  7147. // },
  7148. // "path": "v1/{+name}:setAutoscaling",
  7149. // "request": {
  7150. // "$ref": "SetNodePoolAutoscalingRequest"
  7151. // },
  7152. // "response": {
  7153. // "$ref": "Operation"
  7154. // },
  7155. // "scopes": [
  7156. // "https://www.googleapis.com/auth/cloud-platform"
  7157. // ]
  7158. // }
  7159. }
  7160. // method id "container.projects.locations.clusters.nodePools.setManagement":
  7161. type ProjectsLocationsClustersNodePoolsSetManagementCall struct {
  7162. s *Service
  7163. name string
  7164. setnodepoolmanagementrequest *SetNodePoolManagementRequest
  7165. urlParams_ gensupport.URLParams
  7166. ctx_ context.Context
  7167. header_ http.Header
  7168. }
  7169. // SetManagement: Sets the NodeManagement options for a node pool.
  7170. func (r *ProjectsLocationsClustersNodePoolsService) SetManagement(name string, setnodepoolmanagementrequest *SetNodePoolManagementRequest) *ProjectsLocationsClustersNodePoolsSetManagementCall {
  7171. c := &ProjectsLocationsClustersNodePoolsSetManagementCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7172. c.name = name
  7173. c.setnodepoolmanagementrequest = setnodepoolmanagementrequest
  7174. return c
  7175. }
  7176. // Fields allows partial responses to be retrieved. See
  7177. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7178. // for more information.
  7179. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsSetManagementCall {
  7180. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7181. return c
  7182. }
  7183. // Context sets the context to be used in this call's Do method. Any
  7184. // pending HTTP request will be aborted if the provided context is
  7185. // canceled.
  7186. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsSetManagementCall {
  7187. c.ctx_ = ctx
  7188. return c
  7189. }
  7190. // Header returns an http.Header that can be modified by the caller to
  7191. // add HTTP headers to the request.
  7192. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Header() http.Header {
  7193. if c.header_ == nil {
  7194. c.header_ = make(http.Header)
  7195. }
  7196. return c.header_
  7197. }
  7198. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) doRequest(alt string) (*http.Response, error) {
  7199. reqHeaders := make(http.Header)
  7200. for k, v := range c.header_ {
  7201. reqHeaders[k] = v
  7202. }
  7203. reqHeaders.Set("User-Agent", c.s.userAgent())
  7204. var body io.Reader = nil
  7205. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolmanagementrequest)
  7206. if err != nil {
  7207. return nil, err
  7208. }
  7209. reqHeaders.Set("Content-Type", "application/json")
  7210. c.urlParams_.Set("alt", alt)
  7211. c.urlParams_.Set("prettyPrint", "false")
  7212. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setManagement")
  7213. urls += "?" + c.urlParams_.Encode()
  7214. req, err := http.NewRequest("POST", urls, body)
  7215. if err != nil {
  7216. return nil, err
  7217. }
  7218. req.Header = reqHeaders
  7219. googleapi.Expand(req.URL, map[string]string{
  7220. "name": c.name,
  7221. })
  7222. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7223. }
  7224. // Do executes the "container.projects.locations.clusters.nodePools.setManagement" call.
  7225. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7226. // status code is an error. Response headers are in either
  7227. // *Operation.ServerResponse.Header or (if a response was returned at
  7228. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7229. // to check whether the returned error was because
  7230. // http.StatusNotModified was returned.
  7231. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7232. gensupport.SetOptions(c.urlParams_, opts...)
  7233. res, err := c.doRequest("json")
  7234. if res != nil && res.StatusCode == http.StatusNotModified {
  7235. if res.Body != nil {
  7236. res.Body.Close()
  7237. }
  7238. return nil, &googleapi.Error{
  7239. Code: res.StatusCode,
  7240. Header: res.Header,
  7241. }
  7242. }
  7243. if err != nil {
  7244. return nil, err
  7245. }
  7246. defer googleapi.CloseBody(res)
  7247. if err := googleapi.CheckResponse(res); err != nil {
  7248. return nil, err
  7249. }
  7250. ret := &Operation{
  7251. ServerResponse: googleapi.ServerResponse{
  7252. Header: res.Header,
  7253. HTTPStatusCode: res.StatusCode,
  7254. },
  7255. }
  7256. target := &ret
  7257. if err := gensupport.DecodeResponse(target, res); err != nil {
  7258. return nil, err
  7259. }
  7260. return ret, nil
  7261. // {
  7262. // "description": "Sets the NodeManagement options for a node pool.",
  7263. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setManagement",
  7264. // "httpMethod": "POST",
  7265. // "id": "container.projects.locations.clusters.nodePools.setManagement",
  7266. // "parameterOrder": [
  7267. // "name"
  7268. // ],
  7269. // "parameters": {
  7270. // "name": {
  7271. // "description": "The name (project, location, cluster, node pool id) of the node pool to set\nmanagement properties. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  7272. // "location": "path",
  7273. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  7274. // "required": true,
  7275. // "type": "string"
  7276. // }
  7277. // },
  7278. // "path": "v1/{+name}:setManagement",
  7279. // "request": {
  7280. // "$ref": "SetNodePoolManagementRequest"
  7281. // },
  7282. // "response": {
  7283. // "$ref": "Operation"
  7284. // },
  7285. // "scopes": [
  7286. // "https://www.googleapis.com/auth/cloud-platform"
  7287. // ]
  7288. // }
  7289. }
  7290. // method id "container.projects.locations.clusters.nodePools.setSize":
  7291. type ProjectsLocationsClustersNodePoolsSetSizeCall struct {
  7292. s *Service
  7293. name string
  7294. setnodepoolsizerequest *SetNodePoolSizeRequest
  7295. urlParams_ gensupport.URLParams
  7296. ctx_ context.Context
  7297. header_ http.Header
  7298. }
  7299. // SetSize: Sets the size for a specific node pool.
  7300. func (r *ProjectsLocationsClustersNodePoolsService) SetSize(name string, setnodepoolsizerequest *SetNodePoolSizeRequest) *ProjectsLocationsClustersNodePoolsSetSizeCall {
  7301. c := &ProjectsLocationsClustersNodePoolsSetSizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7302. c.name = name
  7303. c.setnodepoolsizerequest = setnodepoolsizerequest
  7304. return c
  7305. }
  7306. // Fields allows partial responses to be retrieved. See
  7307. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7308. // for more information.
  7309. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsSetSizeCall {
  7310. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7311. return c
  7312. }
  7313. // Context sets the context to be used in this call's Do method. Any
  7314. // pending HTTP request will be aborted if the provided context is
  7315. // canceled.
  7316. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsSetSizeCall {
  7317. c.ctx_ = ctx
  7318. return c
  7319. }
  7320. // Header returns an http.Header that can be modified by the caller to
  7321. // add HTTP headers to the request.
  7322. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Header() http.Header {
  7323. if c.header_ == nil {
  7324. c.header_ = make(http.Header)
  7325. }
  7326. return c.header_
  7327. }
  7328. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) doRequest(alt string) (*http.Response, error) {
  7329. reqHeaders := make(http.Header)
  7330. for k, v := range c.header_ {
  7331. reqHeaders[k] = v
  7332. }
  7333. reqHeaders.Set("User-Agent", c.s.userAgent())
  7334. var body io.Reader = nil
  7335. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolsizerequest)
  7336. if err != nil {
  7337. return nil, err
  7338. }
  7339. reqHeaders.Set("Content-Type", "application/json")
  7340. c.urlParams_.Set("alt", alt)
  7341. c.urlParams_.Set("prettyPrint", "false")
  7342. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setSize")
  7343. urls += "?" + c.urlParams_.Encode()
  7344. req, err := http.NewRequest("POST", urls, body)
  7345. if err != nil {
  7346. return nil, err
  7347. }
  7348. req.Header = reqHeaders
  7349. googleapi.Expand(req.URL, map[string]string{
  7350. "name": c.name,
  7351. })
  7352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7353. }
  7354. // Do executes the "container.projects.locations.clusters.nodePools.setSize" call.
  7355. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7356. // status code is an error. Response headers are in either
  7357. // *Operation.ServerResponse.Header or (if a response was returned at
  7358. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7359. // to check whether the returned error was because
  7360. // http.StatusNotModified was returned.
  7361. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7362. gensupport.SetOptions(c.urlParams_, opts...)
  7363. res, err := c.doRequest("json")
  7364. if res != nil && res.StatusCode == http.StatusNotModified {
  7365. if res.Body != nil {
  7366. res.Body.Close()
  7367. }
  7368. return nil, &googleapi.Error{
  7369. Code: res.StatusCode,
  7370. Header: res.Header,
  7371. }
  7372. }
  7373. if err != nil {
  7374. return nil, err
  7375. }
  7376. defer googleapi.CloseBody(res)
  7377. if err := googleapi.CheckResponse(res); err != nil {
  7378. return nil, err
  7379. }
  7380. ret := &Operation{
  7381. ServerResponse: googleapi.ServerResponse{
  7382. Header: res.Header,
  7383. HTTPStatusCode: res.StatusCode,
  7384. },
  7385. }
  7386. target := &ret
  7387. if err := gensupport.DecodeResponse(target, res); err != nil {
  7388. return nil, err
  7389. }
  7390. return ret, nil
  7391. // {
  7392. // "description": "Sets the size for a specific node pool.",
  7393. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setSize",
  7394. // "httpMethod": "POST",
  7395. // "id": "container.projects.locations.clusters.nodePools.setSize",
  7396. // "parameterOrder": [
  7397. // "name"
  7398. // ],
  7399. // "parameters": {
  7400. // "name": {
  7401. // "description": "The name (project, location, cluster, node pool id) of the node pool to set\nsize.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.",
  7402. // "location": "path",
  7403. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  7404. // "required": true,
  7405. // "type": "string"
  7406. // }
  7407. // },
  7408. // "path": "v1/{+name}:setSize",
  7409. // "request": {
  7410. // "$ref": "SetNodePoolSizeRequest"
  7411. // },
  7412. // "response": {
  7413. // "$ref": "Operation"
  7414. // },
  7415. // "scopes": [
  7416. // "https://www.googleapis.com/auth/cloud-platform"
  7417. // ]
  7418. // }
  7419. }
  7420. // method id "container.projects.locations.clusters.nodePools.update":
  7421. type ProjectsLocationsClustersNodePoolsUpdateCall struct {
  7422. s *Service
  7423. name string
  7424. updatenodepoolrequest *UpdateNodePoolRequest
  7425. urlParams_ gensupport.URLParams
  7426. ctx_ context.Context
  7427. header_ http.Header
  7428. }
  7429. // Update: Updates the version and/or image type for the specified node
  7430. // pool.
  7431. func (r *ProjectsLocationsClustersNodePoolsService) Update(name string, updatenodepoolrequest *UpdateNodePoolRequest) *ProjectsLocationsClustersNodePoolsUpdateCall {
  7432. c := &ProjectsLocationsClustersNodePoolsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7433. c.name = name
  7434. c.updatenodepoolrequest = updatenodepoolrequest
  7435. return c
  7436. }
  7437. // Fields allows partial responses to be retrieved. See
  7438. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7439. // for more information.
  7440. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsUpdateCall {
  7441. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7442. return c
  7443. }
  7444. // Context sets the context to be used in this call's Do method. Any
  7445. // pending HTTP request will be aborted if the provided context is
  7446. // canceled.
  7447. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsUpdateCall {
  7448. c.ctx_ = ctx
  7449. return c
  7450. }
  7451. // Header returns an http.Header that can be modified by the caller to
  7452. // add HTTP headers to the request.
  7453. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Header() http.Header {
  7454. if c.header_ == nil {
  7455. c.header_ = make(http.Header)
  7456. }
  7457. return c.header_
  7458. }
  7459. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7460. reqHeaders := make(http.Header)
  7461. for k, v := range c.header_ {
  7462. reqHeaders[k] = v
  7463. }
  7464. reqHeaders.Set("User-Agent", c.s.userAgent())
  7465. var body io.Reader = nil
  7466. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatenodepoolrequest)
  7467. if err != nil {
  7468. return nil, err
  7469. }
  7470. reqHeaders.Set("Content-Type", "application/json")
  7471. c.urlParams_.Set("alt", alt)
  7472. c.urlParams_.Set("prettyPrint", "false")
  7473. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  7474. urls += "?" + c.urlParams_.Encode()
  7475. req, err := http.NewRequest("PUT", urls, body)
  7476. if err != nil {
  7477. return nil, err
  7478. }
  7479. req.Header = reqHeaders
  7480. googleapi.Expand(req.URL, map[string]string{
  7481. "name": c.name,
  7482. })
  7483. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7484. }
  7485. // Do executes the "container.projects.locations.clusters.nodePools.update" call.
  7486. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7487. // status code is an error. Response headers are in either
  7488. // *Operation.ServerResponse.Header or (if a response was returned at
  7489. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7490. // to check whether the returned error was because
  7491. // http.StatusNotModified was returned.
  7492. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7493. gensupport.SetOptions(c.urlParams_, opts...)
  7494. res, err := c.doRequest("json")
  7495. if res != nil && res.StatusCode == http.StatusNotModified {
  7496. if res.Body != nil {
  7497. res.Body.Close()
  7498. }
  7499. return nil, &googleapi.Error{
  7500. Code: res.StatusCode,
  7501. Header: res.Header,
  7502. }
  7503. }
  7504. if err != nil {
  7505. return nil, err
  7506. }
  7507. defer googleapi.CloseBody(res)
  7508. if err := googleapi.CheckResponse(res); err != nil {
  7509. return nil, err
  7510. }
  7511. ret := &Operation{
  7512. ServerResponse: googleapi.ServerResponse{
  7513. Header: res.Header,
  7514. HTTPStatusCode: res.StatusCode,
  7515. },
  7516. }
  7517. target := &ret
  7518. if err := gensupport.DecodeResponse(target, res); err != nil {
  7519. return nil, err
  7520. }
  7521. return ret, nil
  7522. // {
  7523. // "description": "Updates the version and/or image type for the specified node pool.",
  7524. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
  7525. // "httpMethod": "PUT",
  7526. // "id": "container.projects.locations.clusters.nodePools.update",
  7527. // "parameterOrder": [
  7528. // "name"
  7529. // ],
  7530. // "parameters": {
  7531. // "name": {
  7532. // "description": "The name (project, location, cluster, node pool) of the node pool to\nupdate. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  7533. // "location": "path",
  7534. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  7535. // "required": true,
  7536. // "type": "string"
  7537. // }
  7538. // },
  7539. // "path": "v1/{+name}",
  7540. // "request": {
  7541. // "$ref": "UpdateNodePoolRequest"
  7542. // },
  7543. // "response": {
  7544. // "$ref": "Operation"
  7545. // },
  7546. // "scopes": [
  7547. // "https://www.googleapis.com/auth/cloud-platform"
  7548. // ]
  7549. // }
  7550. }
  7551. // method id "container.projects.locations.clusters.well-known.getOpenid-configuration":
  7552. type ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall struct {
  7553. s *Service
  7554. parent string
  7555. urlParams_ gensupport.URLParams
  7556. ifNoneMatch_ string
  7557. ctx_ context.Context
  7558. header_ http.Header
  7559. }
  7560. // GetOpenidConfiguration: Gets the OIDC discovery document for the
  7561. // cluster.
  7562. // See the
  7563. // [OpenID Connect Discovery
  7564. // 1.0
  7565. // specification](https://openid.net/specs/openid-connect-discovery-1
  7566. // _0.html)
  7567. // for details.
  7568. // This API is not yet intended for general use, and is not available
  7569. // for all
  7570. // clusters.
  7571. func (r *ProjectsLocationsClustersWellKnownService) GetOpenidConfiguration(parent string) *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall {
  7572. c := &ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7573. c.parent = parent
  7574. return c
  7575. }
  7576. // Fields allows partial responses to be retrieved. See
  7577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7578. // for more information.
  7579. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall {
  7580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7581. return c
  7582. }
  7583. // IfNoneMatch sets the optional parameter which makes the operation
  7584. // fail if the object's ETag matches the given value. This is useful for
  7585. // getting updates only after the object has changed since the last
  7586. // request. Use googleapi.IsNotModified to check whether the response
  7587. // error from Do is the result of In-None-Match.
  7588. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall {
  7589. c.ifNoneMatch_ = entityTag
  7590. return c
  7591. }
  7592. // Context sets the context to be used in this call's Do method. Any
  7593. // pending HTTP request will be aborted if the provided context is
  7594. // canceled.
  7595. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) Context(ctx context.Context) *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall {
  7596. c.ctx_ = ctx
  7597. return c
  7598. }
  7599. // Header returns an http.Header that can be modified by the caller to
  7600. // add HTTP headers to the request.
  7601. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) Header() http.Header {
  7602. if c.header_ == nil {
  7603. c.header_ = make(http.Header)
  7604. }
  7605. return c.header_
  7606. }
  7607. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) doRequest(alt string) (*http.Response, error) {
  7608. reqHeaders := make(http.Header)
  7609. for k, v := range c.header_ {
  7610. reqHeaders[k] = v
  7611. }
  7612. reqHeaders.Set("User-Agent", c.s.userAgent())
  7613. if c.ifNoneMatch_ != "" {
  7614. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7615. }
  7616. var body io.Reader = nil
  7617. c.urlParams_.Set("alt", alt)
  7618. c.urlParams_.Set("prettyPrint", "false")
  7619. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/.well-known/openid-configuration")
  7620. urls += "?" + c.urlParams_.Encode()
  7621. req, err := http.NewRequest("GET", urls, body)
  7622. if err != nil {
  7623. return nil, err
  7624. }
  7625. req.Header = reqHeaders
  7626. googleapi.Expand(req.URL, map[string]string{
  7627. "parent": c.parent,
  7628. })
  7629. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7630. }
  7631. // Do executes the "container.projects.locations.clusters.well-known.getOpenid-configuration" call.
  7632. // Exactly one of *GetOpenIDConfigResponse or error will be non-nil. Any
  7633. // non-2xx status code is an error. Response headers are in either
  7634. // *GetOpenIDConfigResponse.ServerResponse.Header or (if a response was
  7635. // returned at all) in error.(*googleapi.Error).Header. Use
  7636. // googleapi.IsNotModified to check whether the returned error was
  7637. // because http.StatusNotModified was returned.
  7638. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) Do(opts ...googleapi.CallOption) (*GetOpenIDConfigResponse, error) {
  7639. gensupport.SetOptions(c.urlParams_, opts...)
  7640. res, err := c.doRequest("json")
  7641. if res != nil && res.StatusCode == http.StatusNotModified {
  7642. if res.Body != nil {
  7643. res.Body.Close()
  7644. }
  7645. return nil, &googleapi.Error{
  7646. Code: res.StatusCode,
  7647. Header: res.Header,
  7648. }
  7649. }
  7650. if err != nil {
  7651. return nil, err
  7652. }
  7653. defer googleapi.CloseBody(res)
  7654. if err := googleapi.CheckResponse(res); err != nil {
  7655. return nil, err
  7656. }
  7657. ret := &GetOpenIDConfigResponse{
  7658. ServerResponse: googleapi.ServerResponse{
  7659. Header: res.Header,
  7660. HTTPStatusCode: res.StatusCode,
  7661. },
  7662. }
  7663. target := &ret
  7664. if err := gensupport.DecodeResponse(target, res); err != nil {
  7665. return nil, err
  7666. }
  7667. return ret, nil
  7668. // {
  7669. // "description": "Gets the OIDC discovery document for the cluster.\nSee the\n[OpenID Connect Discovery 1.0\nspecification](https://openid.net/specs/openid-connect-discovery-1_0.html)\nfor details.\nThis API is not yet intended for general use, and is not available for all\nclusters.",
  7670. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/.well-known/openid-configuration",
  7671. // "httpMethod": "GET",
  7672. // "id": "container.projects.locations.clusters.well-known.getOpenid-configuration",
  7673. // "parameterOrder": [
  7674. // "parent"
  7675. // ],
  7676. // "parameters": {
  7677. // "parent": {
  7678. // "description": "The cluster (project, location, cluster id) to get the discovery document\nfor. Specified in the format 'projects/*/locations/*/clusters/*'.",
  7679. // "location": "path",
  7680. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  7681. // "required": true,
  7682. // "type": "string"
  7683. // }
  7684. // },
  7685. // "path": "v1/{+parent}/.well-known/openid-configuration",
  7686. // "response": {
  7687. // "$ref": "GetOpenIDConfigResponse"
  7688. // }
  7689. // }
  7690. }
  7691. // method id "container.projects.locations.operations.cancel":
  7692. type ProjectsLocationsOperationsCancelCall struct {
  7693. s *Service
  7694. name string
  7695. canceloperationrequest *CancelOperationRequest
  7696. urlParams_ gensupport.URLParams
  7697. ctx_ context.Context
  7698. header_ http.Header
  7699. }
  7700. // Cancel: Cancels the specified operation.
  7701. func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
  7702. c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7703. c.name = name
  7704. c.canceloperationrequest = canceloperationrequest
  7705. return c
  7706. }
  7707. // Fields allows partial responses to be retrieved. See
  7708. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7709. // for more information.
  7710. func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
  7711. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7712. return c
  7713. }
  7714. // Context sets the context to be used in this call's Do method. Any
  7715. // pending HTTP request will be aborted if the provided context is
  7716. // canceled.
  7717. func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
  7718. c.ctx_ = ctx
  7719. return c
  7720. }
  7721. // Header returns an http.Header that can be modified by the caller to
  7722. // add HTTP headers to the request.
  7723. func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
  7724. if c.header_ == nil {
  7725. c.header_ = make(http.Header)
  7726. }
  7727. return c.header_
  7728. }
  7729. func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  7730. reqHeaders := make(http.Header)
  7731. for k, v := range c.header_ {
  7732. reqHeaders[k] = v
  7733. }
  7734. reqHeaders.Set("User-Agent", c.s.userAgent())
  7735. var body io.Reader = nil
  7736. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  7737. if err != nil {
  7738. return nil, err
  7739. }
  7740. reqHeaders.Set("Content-Type", "application/json")
  7741. c.urlParams_.Set("alt", alt)
  7742. c.urlParams_.Set("prettyPrint", "false")
  7743. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  7744. urls += "?" + c.urlParams_.Encode()
  7745. req, err := http.NewRequest("POST", urls, body)
  7746. if err != nil {
  7747. return nil, err
  7748. }
  7749. req.Header = reqHeaders
  7750. googleapi.Expand(req.URL, map[string]string{
  7751. "name": c.name,
  7752. })
  7753. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7754. }
  7755. // Do executes the "container.projects.locations.operations.cancel" call.
  7756. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  7757. // code is an error. Response headers are in either
  7758. // *Empty.ServerResponse.Header or (if a response was returned at all)
  7759. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7760. // check whether the returned error was because http.StatusNotModified
  7761. // was returned.
  7762. func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  7763. gensupport.SetOptions(c.urlParams_, opts...)
  7764. res, err := c.doRequest("json")
  7765. if res != nil && res.StatusCode == http.StatusNotModified {
  7766. if res.Body != nil {
  7767. res.Body.Close()
  7768. }
  7769. return nil, &googleapi.Error{
  7770. Code: res.StatusCode,
  7771. Header: res.Header,
  7772. }
  7773. }
  7774. if err != nil {
  7775. return nil, err
  7776. }
  7777. defer googleapi.CloseBody(res)
  7778. if err := googleapi.CheckResponse(res); err != nil {
  7779. return nil, err
  7780. }
  7781. ret := &Empty{
  7782. ServerResponse: googleapi.ServerResponse{
  7783. Header: res.Header,
  7784. HTTPStatusCode: res.StatusCode,
  7785. },
  7786. }
  7787. target := &ret
  7788. if err := gensupport.DecodeResponse(target, res); err != nil {
  7789. return nil, err
  7790. }
  7791. return ret, nil
  7792. // {
  7793. // "description": "Cancels the specified operation.",
  7794. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel",
  7795. // "httpMethod": "POST",
  7796. // "id": "container.projects.locations.operations.cancel",
  7797. // "parameterOrder": [
  7798. // "name"
  7799. // ],
  7800. // "parameters": {
  7801. // "name": {
  7802. // "description": "The name (project, location, operation id) of the operation to cancel.\nSpecified in the format 'projects/*/locations/*/operations/*'.",
  7803. // "location": "path",
  7804. // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  7805. // "required": true,
  7806. // "type": "string"
  7807. // }
  7808. // },
  7809. // "path": "v1/{+name}:cancel",
  7810. // "request": {
  7811. // "$ref": "CancelOperationRequest"
  7812. // },
  7813. // "response": {
  7814. // "$ref": "Empty"
  7815. // },
  7816. // "scopes": [
  7817. // "https://www.googleapis.com/auth/cloud-platform"
  7818. // ]
  7819. // }
  7820. }
  7821. // method id "container.projects.locations.operations.get":
  7822. type ProjectsLocationsOperationsGetCall struct {
  7823. s *Service
  7824. name string
  7825. urlParams_ gensupport.URLParams
  7826. ifNoneMatch_ string
  7827. ctx_ context.Context
  7828. header_ http.Header
  7829. }
  7830. // Get: Gets the specified operation.
  7831. func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  7832. c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7833. c.name = name
  7834. return c
  7835. }
  7836. // OperationId sets the optional parameter "operationId": Deprecated.
  7837. // The server-assigned `name` of the operation.
  7838. // This field has been deprecated and replaced by the name field.
  7839. func (c *ProjectsLocationsOperationsGetCall) OperationId(operationId string) *ProjectsLocationsOperationsGetCall {
  7840. c.urlParams_.Set("operationId", operationId)
  7841. return c
  7842. }
  7843. // ProjectId sets the optional parameter "projectId": Deprecated. The
  7844. // Google Developers Console [project ID or
  7845. // project
  7846. // number](https://support.google.com/cloud/answer/6158840).
  7847. // This
  7848. // field has been deprecated and replaced by the name field.
  7849. func (c *ProjectsLocationsOperationsGetCall) ProjectId(projectId string) *ProjectsLocationsOperationsGetCall {
  7850. c.urlParams_.Set("projectId", projectId)
  7851. return c
  7852. }
  7853. // Zone sets the optional parameter "zone": Deprecated. The name of the
  7854. // Google Compute Engine
  7855. // [zone](/compute/docs/zones#available) in which the
  7856. // cluster
  7857. // resides.
  7858. // This field has been deprecated and replaced by the name field.
  7859. func (c *ProjectsLocationsOperationsGetCall) Zone(zone string) *ProjectsLocationsOperationsGetCall {
  7860. c.urlParams_.Set("zone", zone)
  7861. return c
  7862. }
  7863. // Fields allows partial responses to be retrieved. See
  7864. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7865. // for more information.
  7866. func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  7867. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7868. return c
  7869. }
  7870. // IfNoneMatch sets the optional parameter which makes the operation
  7871. // fail if the object's ETag matches the given value. This is useful for
  7872. // getting updates only after the object has changed since the last
  7873. // request. Use googleapi.IsNotModified to check whether the response
  7874. // error from Do is the result of In-None-Match.
  7875. func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  7876. c.ifNoneMatch_ = entityTag
  7877. return c
  7878. }
  7879. // Context sets the context to be used in this call's Do method. Any
  7880. // pending HTTP request will be aborted if the provided context is
  7881. // canceled.
  7882. func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  7883. c.ctx_ = ctx
  7884. return c
  7885. }
  7886. // Header returns an http.Header that can be modified by the caller to
  7887. // add HTTP headers to the request.
  7888. func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  7889. if c.header_ == nil {
  7890. c.header_ = make(http.Header)
  7891. }
  7892. return c.header_
  7893. }
  7894. func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  7895. reqHeaders := make(http.Header)
  7896. for k, v := range c.header_ {
  7897. reqHeaders[k] = v
  7898. }
  7899. reqHeaders.Set("User-Agent", c.s.userAgent())
  7900. if c.ifNoneMatch_ != "" {
  7901. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7902. }
  7903. var body io.Reader = nil
  7904. c.urlParams_.Set("alt", alt)
  7905. c.urlParams_.Set("prettyPrint", "false")
  7906. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  7907. urls += "?" + c.urlParams_.Encode()
  7908. req, err := http.NewRequest("GET", urls, body)
  7909. if err != nil {
  7910. return nil, err
  7911. }
  7912. req.Header = reqHeaders
  7913. googleapi.Expand(req.URL, map[string]string{
  7914. "name": c.name,
  7915. })
  7916. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7917. }
  7918. // Do executes the "container.projects.locations.operations.get" call.
  7919. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7920. // status code is an error. Response headers are in either
  7921. // *Operation.ServerResponse.Header or (if a response was returned at
  7922. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7923. // to check whether the returned error was because
  7924. // http.StatusNotModified was returned.
  7925. func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7926. gensupport.SetOptions(c.urlParams_, opts...)
  7927. res, err := c.doRequest("json")
  7928. if res != nil && res.StatusCode == http.StatusNotModified {
  7929. if res.Body != nil {
  7930. res.Body.Close()
  7931. }
  7932. return nil, &googleapi.Error{
  7933. Code: res.StatusCode,
  7934. Header: res.Header,
  7935. }
  7936. }
  7937. if err != nil {
  7938. return nil, err
  7939. }
  7940. defer googleapi.CloseBody(res)
  7941. if err := googleapi.CheckResponse(res); err != nil {
  7942. return nil, err
  7943. }
  7944. ret := &Operation{
  7945. ServerResponse: googleapi.ServerResponse{
  7946. Header: res.Header,
  7947. HTTPStatusCode: res.StatusCode,
  7948. },
  7949. }
  7950. target := &ret
  7951. if err := gensupport.DecodeResponse(target, res); err != nil {
  7952. return nil, err
  7953. }
  7954. return ret, nil
  7955. // {
  7956. // "description": "Gets the specified operation.",
  7957. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
  7958. // "httpMethod": "GET",
  7959. // "id": "container.projects.locations.operations.get",
  7960. // "parameterOrder": [
  7961. // "name"
  7962. // ],
  7963. // "parameters": {
  7964. // "name": {
  7965. // "description": "The name (project, location, operation id) of the operation to get.\nSpecified in the format 'projects/*/locations/*/operations/*'.",
  7966. // "location": "path",
  7967. // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  7968. // "required": true,
  7969. // "type": "string"
  7970. // },
  7971. // "operationId": {
  7972. // "description": "Deprecated. The server-assigned `name` of the operation.\nThis field has been deprecated and replaced by the name field.",
  7973. // "location": "query",
  7974. // "type": "string"
  7975. // },
  7976. // "projectId": {
  7977. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  7978. // "location": "query",
  7979. // "type": "string"
  7980. // },
  7981. // "zone": {
  7982. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  7983. // "location": "query",
  7984. // "type": "string"
  7985. // }
  7986. // },
  7987. // "path": "v1/{+name}",
  7988. // "response": {
  7989. // "$ref": "Operation"
  7990. // },
  7991. // "scopes": [
  7992. // "https://www.googleapis.com/auth/cloud-platform"
  7993. // ]
  7994. // }
  7995. }
  7996. // method id "container.projects.locations.operations.list":
  7997. type ProjectsLocationsOperationsListCall struct {
  7998. s *Service
  7999. parent string
  8000. urlParams_ gensupport.URLParams
  8001. ifNoneMatch_ string
  8002. ctx_ context.Context
  8003. header_ http.Header
  8004. }
  8005. // List: Lists all operations in a project in a specific zone or all
  8006. // zones.
  8007. func (r *ProjectsLocationsOperationsService) List(parent string) *ProjectsLocationsOperationsListCall {
  8008. c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8009. c.parent = parent
  8010. return c
  8011. }
  8012. // ProjectId sets the optional parameter "projectId": Deprecated. The
  8013. // Google Developers Console [project ID or
  8014. // project
  8015. // number](https://support.google.com/cloud/answer/6158840).
  8016. // This
  8017. // field has been deprecated and replaced by the parent field.
  8018. func (c *ProjectsLocationsOperationsListCall) ProjectId(projectId string) *ProjectsLocationsOperationsListCall {
  8019. c.urlParams_.Set("projectId", projectId)
  8020. return c
  8021. }
  8022. // Zone sets the optional parameter "zone": Deprecated. The name of the
  8023. // Google Compute Engine
  8024. // [zone](/compute/docs/zones#available) to return operations for, or
  8025. // `-` for
  8026. // all zones. This field has been deprecated and replaced by the parent
  8027. // field.
  8028. func (c *ProjectsLocationsOperationsListCall) Zone(zone string) *ProjectsLocationsOperationsListCall {
  8029. c.urlParams_.Set("zone", zone)
  8030. return c
  8031. }
  8032. // Fields allows partial responses to be retrieved. See
  8033. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8034. // for more information.
  8035. func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  8036. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8037. return c
  8038. }
  8039. // IfNoneMatch sets the optional parameter which makes the operation
  8040. // fail if the object's ETag matches the given value. This is useful for
  8041. // getting updates only after the object has changed since the last
  8042. // request. Use googleapi.IsNotModified to check whether the response
  8043. // error from Do is the result of In-None-Match.
  8044. func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  8045. c.ifNoneMatch_ = entityTag
  8046. return c
  8047. }
  8048. // Context sets the context to be used in this call's Do method. Any
  8049. // pending HTTP request will be aborted if the provided context is
  8050. // canceled.
  8051. func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  8052. c.ctx_ = ctx
  8053. return c
  8054. }
  8055. // Header returns an http.Header that can be modified by the caller to
  8056. // add HTTP headers to the request.
  8057. func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  8058. if c.header_ == nil {
  8059. c.header_ = make(http.Header)
  8060. }
  8061. return c.header_
  8062. }
  8063. func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  8064. reqHeaders := make(http.Header)
  8065. for k, v := range c.header_ {
  8066. reqHeaders[k] = v
  8067. }
  8068. reqHeaders.Set("User-Agent", c.s.userAgent())
  8069. if c.ifNoneMatch_ != "" {
  8070. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8071. }
  8072. var body io.Reader = nil
  8073. c.urlParams_.Set("alt", alt)
  8074. c.urlParams_.Set("prettyPrint", "false")
  8075. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/operations")
  8076. urls += "?" + c.urlParams_.Encode()
  8077. req, err := http.NewRequest("GET", urls, body)
  8078. if err != nil {
  8079. return nil, err
  8080. }
  8081. req.Header = reqHeaders
  8082. googleapi.Expand(req.URL, map[string]string{
  8083. "parent": c.parent,
  8084. })
  8085. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8086. }
  8087. // Do executes the "container.projects.locations.operations.list" call.
  8088. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  8089. // non-2xx status code is an error. Response headers are in either
  8090. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  8091. // returned at all) in error.(*googleapi.Error).Header. Use
  8092. // googleapi.IsNotModified to check whether the returned error was
  8093. // because http.StatusNotModified was returned.
  8094. func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  8095. gensupport.SetOptions(c.urlParams_, opts...)
  8096. res, err := c.doRequest("json")
  8097. if res != nil && res.StatusCode == http.StatusNotModified {
  8098. if res.Body != nil {
  8099. res.Body.Close()
  8100. }
  8101. return nil, &googleapi.Error{
  8102. Code: res.StatusCode,
  8103. Header: res.Header,
  8104. }
  8105. }
  8106. if err != nil {
  8107. return nil, err
  8108. }
  8109. defer googleapi.CloseBody(res)
  8110. if err := googleapi.CheckResponse(res); err != nil {
  8111. return nil, err
  8112. }
  8113. ret := &ListOperationsResponse{
  8114. ServerResponse: googleapi.ServerResponse{
  8115. Header: res.Header,
  8116. HTTPStatusCode: res.StatusCode,
  8117. },
  8118. }
  8119. target := &ret
  8120. if err := gensupport.DecodeResponse(target, res); err != nil {
  8121. return nil, err
  8122. }
  8123. return ret, nil
  8124. // {
  8125. // "description": "Lists all operations in a project in a specific zone or all zones.",
  8126. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations",
  8127. // "httpMethod": "GET",
  8128. // "id": "container.projects.locations.operations.list",
  8129. // "parameterOrder": [
  8130. // "parent"
  8131. // ],
  8132. // "parameters": {
  8133. // "parent": {
  8134. // "description": "The parent (project and location) where the operations will be listed.\nSpecified in the format 'projects/*/locations/*'.\nLocation \"-\" matches all zones and all regions.",
  8135. // "location": "path",
  8136. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  8137. // "required": true,
  8138. // "type": "string"
  8139. // },
  8140. // "projectId": {
  8141. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the parent field.",
  8142. // "location": "query",
  8143. // "type": "string"
  8144. // },
  8145. // "zone": {
  8146. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) to return operations for, or `-` for\nall zones. This field has been deprecated and replaced by the parent field.",
  8147. // "location": "query",
  8148. // "type": "string"
  8149. // }
  8150. // },
  8151. // "path": "v1/{+parent}/operations",
  8152. // "response": {
  8153. // "$ref": "ListOperationsResponse"
  8154. // },
  8155. // "scopes": [
  8156. // "https://www.googleapis.com/auth/cloud-platform"
  8157. // ]
  8158. // }
  8159. }
  8160. // method id "container.projects.zones.getServerconfig":
  8161. type ProjectsZonesGetServerconfigCall struct {
  8162. s *Service
  8163. projectId string
  8164. zone string
  8165. urlParams_ gensupport.URLParams
  8166. ifNoneMatch_ string
  8167. ctx_ context.Context
  8168. header_ http.Header
  8169. }
  8170. // GetServerconfig: Returns configuration info about the Google
  8171. // Kubernetes Engine service.
  8172. func (r *ProjectsZonesService) GetServerconfig(projectId string, zone string) *ProjectsZonesGetServerconfigCall {
  8173. c := &ProjectsZonesGetServerconfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8174. c.projectId = projectId
  8175. c.zone = zone
  8176. return c
  8177. }
  8178. // Name sets the optional parameter "name": The name (project and
  8179. // location) of the server config to get,
  8180. // specified in the format 'projects/*/locations/*'.
  8181. func (c *ProjectsZonesGetServerconfigCall) Name(name string) *ProjectsZonesGetServerconfigCall {
  8182. c.urlParams_.Set("name", name)
  8183. return c
  8184. }
  8185. // Fields allows partial responses to be retrieved. See
  8186. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8187. // for more information.
  8188. func (c *ProjectsZonesGetServerconfigCall) Fields(s ...googleapi.Field) *ProjectsZonesGetServerconfigCall {
  8189. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8190. return c
  8191. }
  8192. // IfNoneMatch sets the optional parameter which makes the operation
  8193. // fail if the object's ETag matches the given value. This is useful for
  8194. // getting updates only after the object has changed since the last
  8195. // request. Use googleapi.IsNotModified to check whether the response
  8196. // error from Do is the result of In-None-Match.
  8197. func (c *ProjectsZonesGetServerconfigCall) IfNoneMatch(entityTag string) *ProjectsZonesGetServerconfigCall {
  8198. c.ifNoneMatch_ = entityTag
  8199. return c
  8200. }
  8201. // Context sets the context to be used in this call's Do method. Any
  8202. // pending HTTP request will be aborted if the provided context is
  8203. // canceled.
  8204. func (c *ProjectsZonesGetServerconfigCall) Context(ctx context.Context) *ProjectsZonesGetServerconfigCall {
  8205. c.ctx_ = ctx
  8206. return c
  8207. }
  8208. // Header returns an http.Header that can be modified by the caller to
  8209. // add HTTP headers to the request.
  8210. func (c *ProjectsZonesGetServerconfigCall) Header() http.Header {
  8211. if c.header_ == nil {
  8212. c.header_ = make(http.Header)
  8213. }
  8214. return c.header_
  8215. }
  8216. func (c *ProjectsZonesGetServerconfigCall) doRequest(alt string) (*http.Response, error) {
  8217. reqHeaders := make(http.Header)
  8218. for k, v := range c.header_ {
  8219. reqHeaders[k] = v
  8220. }
  8221. reqHeaders.Set("User-Agent", c.s.userAgent())
  8222. if c.ifNoneMatch_ != "" {
  8223. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8224. }
  8225. var body io.Reader = nil
  8226. c.urlParams_.Set("alt", alt)
  8227. c.urlParams_.Set("prettyPrint", "false")
  8228. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/serverconfig")
  8229. urls += "?" + c.urlParams_.Encode()
  8230. req, err := http.NewRequest("GET", urls, body)
  8231. if err != nil {
  8232. return nil, err
  8233. }
  8234. req.Header = reqHeaders
  8235. googleapi.Expand(req.URL, map[string]string{
  8236. "projectId": c.projectId,
  8237. "zone": c.zone,
  8238. })
  8239. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8240. }
  8241. // Do executes the "container.projects.zones.getServerconfig" call.
  8242. // Exactly one of *ServerConfig or error will be non-nil. Any non-2xx
  8243. // status code is an error. Response headers are in either
  8244. // *ServerConfig.ServerResponse.Header or (if a response was returned at
  8245. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8246. // to check whether the returned error was because
  8247. // http.StatusNotModified was returned.
  8248. func (c *ProjectsZonesGetServerconfigCall) Do(opts ...googleapi.CallOption) (*ServerConfig, error) {
  8249. gensupport.SetOptions(c.urlParams_, opts...)
  8250. res, err := c.doRequest("json")
  8251. if res != nil && res.StatusCode == http.StatusNotModified {
  8252. if res.Body != nil {
  8253. res.Body.Close()
  8254. }
  8255. return nil, &googleapi.Error{
  8256. Code: res.StatusCode,
  8257. Header: res.Header,
  8258. }
  8259. }
  8260. if err != nil {
  8261. return nil, err
  8262. }
  8263. defer googleapi.CloseBody(res)
  8264. if err := googleapi.CheckResponse(res); err != nil {
  8265. return nil, err
  8266. }
  8267. ret := &ServerConfig{
  8268. ServerResponse: googleapi.ServerResponse{
  8269. Header: res.Header,
  8270. HTTPStatusCode: res.StatusCode,
  8271. },
  8272. }
  8273. target := &ret
  8274. if err := gensupport.DecodeResponse(target, res); err != nil {
  8275. return nil, err
  8276. }
  8277. return ret, nil
  8278. // {
  8279. // "description": "Returns configuration info about the Google Kubernetes Engine service.",
  8280. // "flatPath": "v1/projects/{projectId}/zones/{zone}/serverconfig",
  8281. // "httpMethod": "GET",
  8282. // "id": "container.projects.zones.getServerconfig",
  8283. // "parameterOrder": [
  8284. // "projectId",
  8285. // "zone"
  8286. // ],
  8287. // "parameters": {
  8288. // "name": {
  8289. // "description": "The name (project and location) of the server config to get,\nspecified in the format 'projects/*/locations/*'.",
  8290. // "location": "query",
  8291. // "type": "string"
  8292. // },
  8293. // "projectId": {
  8294. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  8295. // "location": "path",
  8296. // "required": true,
  8297. // "type": "string"
  8298. // },
  8299. // "zone": {
  8300. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) to return operations for.\nThis field has been deprecated and replaced by the name field.",
  8301. // "location": "path",
  8302. // "required": true,
  8303. // "type": "string"
  8304. // }
  8305. // },
  8306. // "path": "v1/projects/{projectId}/zones/{zone}/serverconfig",
  8307. // "response": {
  8308. // "$ref": "ServerConfig"
  8309. // },
  8310. // "scopes": [
  8311. // "https://www.googleapis.com/auth/cloud-platform"
  8312. // ]
  8313. // }
  8314. }
  8315. // method id "container.projects.zones.clusters.addons":
  8316. type ProjectsZonesClustersAddonsCall struct {
  8317. s *Service
  8318. projectId string
  8319. zone string
  8320. clusterId string
  8321. setaddonsconfigrequest *SetAddonsConfigRequest
  8322. urlParams_ gensupport.URLParams
  8323. ctx_ context.Context
  8324. header_ http.Header
  8325. }
  8326. // Addons: Sets the addons for a specific cluster.
  8327. func (r *ProjectsZonesClustersService) Addons(projectId string, zone string, clusterId string, setaddonsconfigrequest *SetAddonsConfigRequest) *ProjectsZonesClustersAddonsCall {
  8328. c := &ProjectsZonesClustersAddonsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8329. c.projectId = projectId
  8330. c.zone = zone
  8331. c.clusterId = clusterId
  8332. c.setaddonsconfigrequest = setaddonsconfigrequest
  8333. return c
  8334. }
  8335. // Fields allows partial responses to be retrieved. See
  8336. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8337. // for more information.
  8338. func (c *ProjectsZonesClustersAddonsCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersAddonsCall {
  8339. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8340. return c
  8341. }
  8342. // Context sets the context to be used in this call's Do method. Any
  8343. // pending HTTP request will be aborted if the provided context is
  8344. // canceled.
  8345. func (c *ProjectsZonesClustersAddonsCall) Context(ctx context.Context) *ProjectsZonesClustersAddonsCall {
  8346. c.ctx_ = ctx
  8347. return c
  8348. }
  8349. // Header returns an http.Header that can be modified by the caller to
  8350. // add HTTP headers to the request.
  8351. func (c *ProjectsZonesClustersAddonsCall) Header() http.Header {
  8352. if c.header_ == nil {
  8353. c.header_ = make(http.Header)
  8354. }
  8355. return c.header_
  8356. }
  8357. func (c *ProjectsZonesClustersAddonsCall) doRequest(alt string) (*http.Response, error) {
  8358. reqHeaders := make(http.Header)
  8359. for k, v := range c.header_ {
  8360. reqHeaders[k] = v
  8361. }
  8362. reqHeaders.Set("User-Agent", c.s.userAgent())
  8363. var body io.Reader = nil
  8364. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setaddonsconfigrequest)
  8365. if err != nil {
  8366. return nil, err
  8367. }
  8368. reqHeaders.Set("Content-Type", "application/json")
  8369. c.urlParams_.Set("alt", alt)
  8370. c.urlParams_.Set("prettyPrint", "false")
  8371. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons")
  8372. urls += "?" + c.urlParams_.Encode()
  8373. req, err := http.NewRequest("POST", urls, body)
  8374. if err != nil {
  8375. return nil, err
  8376. }
  8377. req.Header = reqHeaders
  8378. googleapi.Expand(req.URL, map[string]string{
  8379. "projectId": c.projectId,
  8380. "zone": c.zone,
  8381. "clusterId": c.clusterId,
  8382. })
  8383. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8384. }
  8385. // Do executes the "container.projects.zones.clusters.addons" call.
  8386. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8387. // status code is an error. Response headers are in either
  8388. // *Operation.ServerResponse.Header or (if a response was returned at
  8389. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8390. // to check whether the returned error was because
  8391. // http.StatusNotModified was returned.
  8392. func (c *ProjectsZonesClustersAddonsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8393. gensupport.SetOptions(c.urlParams_, opts...)
  8394. res, err := c.doRequest("json")
  8395. if res != nil && res.StatusCode == http.StatusNotModified {
  8396. if res.Body != nil {
  8397. res.Body.Close()
  8398. }
  8399. return nil, &googleapi.Error{
  8400. Code: res.StatusCode,
  8401. Header: res.Header,
  8402. }
  8403. }
  8404. if err != nil {
  8405. return nil, err
  8406. }
  8407. defer googleapi.CloseBody(res)
  8408. if err := googleapi.CheckResponse(res); err != nil {
  8409. return nil, err
  8410. }
  8411. ret := &Operation{
  8412. ServerResponse: googleapi.ServerResponse{
  8413. Header: res.Header,
  8414. HTTPStatusCode: res.StatusCode,
  8415. },
  8416. }
  8417. target := &ret
  8418. if err := gensupport.DecodeResponse(target, res); err != nil {
  8419. return nil, err
  8420. }
  8421. return ret, nil
  8422. // {
  8423. // "description": "Sets the addons for a specific cluster.",
  8424. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons",
  8425. // "httpMethod": "POST",
  8426. // "id": "container.projects.zones.clusters.addons",
  8427. // "parameterOrder": [
  8428. // "projectId",
  8429. // "zone",
  8430. // "clusterId"
  8431. // ],
  8432. // "parameters": {
  8433. // "clusterId": {
  8434. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  8435. // "location": "path",
  8436. // "required": true,
  8437. // "type": "string"
  8438. // },
  8439. // "projectId": {
  8440. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  8441. // "location": "path",
  8442. // "required": true,
  8443. // "type": "string"
  8444. // },
  8445. // "zone": {
  8446. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  8447. // "location": "path",
  8448. // "required": true,
  8449. // "type": "string"
  8450. // }
  8451. // },
  8452. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons",
  8453. // "request": {
  8454. // "$ref": "SetAddonsConfigRequest"
  8455. // },
  8456. // "response": {
  8457. // "$ref": "Operation"
  8458. // },
  8459. // "scopes": [
  8460. // "https://www.googleapis.com/auth/cloud-platform"
  8461. // ]
  8462. // }
  8463. }
  8464. // method id "container.projects.zones.clusters.completeIpRotation":
  8465. type ProjectsZonesClustersCompleteIpRotationCall struct {
  8466. s *Service
  8467. projectId string
  8468. zone string
  8469. clusterId string
  8470. completeiprotationrequest *CompleteIPRotationRequest
  8471. urlParams_ gensupport.URLParams
  8472. ctx_ context.Context
  8473. header_ http.Header
  8474. }
  8475. // CompleteIpRotation: Completes master IP rotation.
  8476. func (r *ProjectsZonesClustersService) CompleteIpRotation(projectId string, zone string, clusterId string, completeiprotationrequest *CompleteIPRotationRequest) *ProjectsZonesClustersCompleteIpRotationCall {
  8477. c := &ProjectsZonesClustersCompleteIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8478. c.projectId = projectId
  8479. c.zone = zone
  8480. c.clusterId = clusterId
  8481. c.completeiprotationrequest = completeiprotationrequest
  8482. return c
  8483. }
  8484. // Fields allows partial responses to be retrieved. See
  8485. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8486. // for more information.
  8487. func (c *ProjectsZonesClustersCompleteIpRotationCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersCompleteIpRotationCall {
  8488. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8489. return c
  8490. }
  8491. // Context sets the context to be used in this call's Do method. Any
  8492. // pending HTTP request will be aborted if the provided context is
  8493. // canceled.
  8494. func (c *ProjectsZonesClustersCompleteIpRotationCall) Context(ctx context.Context) *ProjectsZonesClustersCompleteIpRotationCall {
  8495. c.ctx_ = ctx
  8496. return c
  8497. }
  8498. // Header returns an http.Header that can be modified by the caller to
  8499. // add HTTP headers to the request.
  8500. func (c *ProjectsZonesClustersCompleteIpRotationCall) Header() http.Header {
  8501. if c.header_ == nil {
  8502. c.header_ = make(http.Header)
  8503. }
  8504. return c.header_
  8505. }
  8506. func (c *ProjectsZonesClustersCompleteIpRotationCall) doRequest(alt string) (*http.Response, error) {
  8507. reqHeaders := make(http.Header)
  8508. for k, v := range c.header_ {
  8509. reqHeaders[k] = v
  8510. }
  8511. reqHeaders.Set("User-Agent", c.s.userAgent())
  8512. var body io.Reader = nil
  8513. body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeiprotationrequest)
  8514. if err != nil {
  8515. return nil, err
  8516. }
  8517. reqHeaders.Set("Content-Type", "application/json")
  8518. c.urlParams_.Set("alt", alt)
  8519. c.urlParams_.Set("prettyPrint", "false")
  8520. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation")
  8521. urls += "?" + c.urlParams_.Encode()
  8522. req, err := http.NewRequest("POST", urls, body)
  8523. if err != nil {
  8524. return nil, err
  8525. }
  8526. req.Header = reqHeaders
  8527. googleapi.Expand(req.URL, map[string]string{
  8528. "projectId": c.projectId,
  8529. "zone": c.zone,
  8530. "clusterId": c.clusterId,
  8531. })
  8532. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8533. }
  8534. // Do executes the "container.projects.zones.clusters.completeIpRotation" call.
  8535. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8536. // status code is an error. Response headers are in either
  8537. // *Operation.ServerResponse.Header or (if a response was returned at
  8538. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8539. // to check whether the returned error was because
  8540. // http.StatusNotModified was returned.
  8541. func (c *ProjectsZonesClustersCompleteIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8542. gensupport.SetOptions(c.urlParams_, opts...)
  8543. res, err := c.doRequest("json")
  8544. if res != nil && res.StatusCode == http.StatusNotModified {
  8545. if res.Body != nil {
  8546. res.Body.Close()
  8547. }
  8548. return nil, &googleapi.Error{
  8549. Code: res.StatusCode,
  8550. Header: res.Header,
  8551. }
  8552. }
  8553. if err != nil {
  8554. return nil, err
  8555. }
  8556. defer googleapi.CloseBody(res)
  8557. if err := googleapi.CheckResponse(res); err != nil {
  8558. return nil, err
  8559. }
  8560. ret := &Operation{
  8561. ServerResponse: googleapi.ServerResponse{
  8562. Header: res.Header,
  8563. HTTPStatusCode: res.StatusCode,
  8564. },
  8565. }
  8566. target := &ret
  8567. if err := gensupport.DecodeResponse(target, res); err != nil {
  8568. return nil, err
  8569. }
  8570. return ret, nil
  8571. // {
  8572. // "description": "Completes master IP rotation.",
  8573. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation",
  8574. // "httpMethod": "POST",
  8575. // "id": "container.projects.zones.clusters.completeIpRotation",
  8576. // "parameterOrder": [
  8577. // "projectId",
  8578. // "zone",
  8579. // "clusterId"
  8580. // ],
  8581. // "parameters": {
  8582. // "clusterId": {
  8583. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  8584. // "location": "path",
  8585. // "required": true,
  8586. // "type": "string"
  8587. // },
  8588. // "projectId": {
  8589. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  8590. // "location": "path",
  8591. // "required": true,
  8592. // "type": "string"
  8593. // },
  8594. // "zone": {
  8595. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  8596. // "location": "path",
  8597. // "required": true,
  8598. // "type": "string"
  8599. // }
  8600. // },
  8601. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation",
  8602. // "request": {
  8603. // "$ref": "CompleteIPRotationRequest"
  8604. // },
  8605. // "response": {
  8606. // "$ref": "Operation"
  8607. // },
  8608. // "scopes": [
  8609. // "https://www.googleapis.com/auth/cloud-platform"
  8610. // ]
  8611. // }
  8612. }
  8613. // method id "container.projects.zones.clusters.create":
  8614. type ProjectsZonesClustersCreateCall struct {
  8615. s *Service
  8616. projectId string
  8617. zone string
  8618. createclusterrequest *CreateClusterRequest
  8619. urlParams_ gensupport.URLParams
  8620. ctx_ context.Context
  8621. header_ http.Header
  8622. }
  8623. // Create: Creates a cluster, consisting of the specified number and
  8624. // type of Google
  8625. // Compute Engine instances.
  8626. //
  8627. // By default, the cluster is created in the project's
  8628. // [default
  8629. // network](/compute/docs/networks-and-firewalls#networks).
  8630. //
  8631. // One firewall is added for the cluster. After cluster creation,
  8632. // the Kubelet creates routes for each node to allow the containers
  8633. // on that node to communicate with all other instances in
  8634. // the
  8635. // cluster.
  8636. //
  8637. // Finally, an entry is added to the project's global metadata
  8638. // indicating
  8639. // which CIDR range the cluster is using.
  8640. func (r *ProjectsZonesClustersService) Create(projectId string, zone string, createclusterrequest *CreateClusterRequest) *ProjectsZonesClustersCreateCall {
  8641. c := &ProjectsZonesClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8642. c.projectId = projectId
  8643. c.zone = zone
  8644. c.createclusterrequest = createclusterrequest
  8645. return c
  8646. }
  8647. // Fields allows partial responses to be retrieved. See
  8648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8649. // for more information.
  8650. func (c *ProjectsZonesClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersCreateCall {
  8651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8652. return c
  8653. }
  8654. // Context sets the context to be used in this call's Do method. Any
  8655. // pending HTTP request will be aborted if the provided context is
  8656. // canceled.
  8657. func (c *ProjectsZonesClustersCreateCall) Context(ctx context.Context) *ProjectsZonesClustersCreateCall {
  8658. c.ctx_ = ctx
  8659. return c
  8660. }
  8661. // Header returns an http.Header that can be modified by the caller to
  8662. // add HTTP headers to the request.
  8663. func (c *ProjectsZonesClustersCreateCall) Header() http.Header {
  8664. if c.header_ == nil {
  8665. c.header_ = make(http.Header)
  8666. }
  8667. return c.header_
  8668. }
  8669. func (c *ProjectsZonesClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  8670. reqHeaders := make(http.Header)
  8671. for k, v := range c.header_ {
  8672. reqHeaders[k] = v
  8673. }
  8674. reqHeaders.Set("User-Agent", c.s.userAgent())
  8675. var body io.Reader = nil
  8676. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest)
  8677. if err != nil {
  8678. return nil, err
  8679. }
  8680. reqHeaders.Set("Content-Type", "application/json")
  8681. c.urlParams_.Set("alt", alt)
  8682. c.urlParams_.Set("prettyPrint", "false")
  8683. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters")
  8684. urls += "?" + c.urlParams_.Encode()
  8685. req, err := http.NewRequest("POST", urls, body)
  8686. if err != nil {
  8687. return nil, err
  8688. }
  8689. req.Header = reqHeaders
  8690. googleapi.Expand(req.URL, map[string]string{
  8691. "projectId": c.projectId,
  8692. "zone": c.zone,
  8693. })
  8694. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8695. }
  8696. // Do executes the "container.projects.zones.clusters.create" call.
  8697. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8698. // status code is an error. Response headers are in either
  8699. // *Operation.ServerResponse.Header or (if a response was returned at
  8700. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8701. // to check whether the returned error was because
  8702. // http.StatusNotModified was returned.
  8703. func (c *ProjectsZonesClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8704. gensupport.SetOptions(c.urlParams_, opts...)
  8705. res, err := c.doRequest("json")
  8706. if res != nil && res.StatusCode == http.StatusNotModified {
  8707. if res.Body != nil {
  8708. res.Body.Close()
  8709. }
  8710. return nil, &googleapi.Error{
  8711. Code: res.StatusCode,
  8712. Header: res.Header,
  8713. }
  8714. }
  8715. if err != nil {
  8716. return nil, err
  8717. }
  8718. defer googleapi.CloseBody(res)
  8719. if err := googleapi.CheckResponse(res); err != nil {
  8720. return nil, err
  8721. }
  8722. ret := &Operation{
  8723. ServerResponse: googleapi.ServerResponse{
  8724. Header: res.Header,
  8725. HTTPStatusCode: res.StatusCode,
  8726. },
  8727. }
  8728. target := &ret
  8729. if err := gensupport.DecodeResponse(target, res); err != nil {
  8730. return nil, err
  8731. }
  8732. return ret, nil
  8733. // {
  8734. // "description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe Kubelet creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range the cluster is using.",
  8735. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters",
  8736. // "httpMethod": "POST",
  8737. // "id": "container.projects.zones.clusters.create",
  8738. // "parameterOrder": [
  8739. // "projectId",
  8740. // "zone"
  8741. // ],
  8742. // "parameters": {
  8743. // "projectId": {
  8744. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the parent field.",
  8745. // "location": "path",
  8746. // "required": true,
  8747. // "type": "string"
  8748. // },
  8749. // "zone": {
  8750. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the parent field.",
  8751. // "location": "path",
  8752. // "required": true,
  8753. // "type": "string"
  8754. // }
  8755. // },
  8756. // "path": "v1/projects/{projectId}/zones/{zone}/clusters",
  8757. // "request": {
  8758. // "$ref": "CreateClusterRequest"
  8759. // },
  8760. // "response": {
  8761. // "$ref": "Operation"
  8762. // },
  8763. // "scopes": [
  8764. // "https://www.googleapis.com/auth/cloud-platform"
  8765. // ]
  8766. // }
  8767. }
  8768. // method id "container.projects.zones.clusters.delete":
  8769. type ProjectsZonesClustersDeleteCall struct {
  8770. s *Service
  8771. projectId string
  8772. zone string
  8773. clusterId string
  8774. urlParams_ gensupport.URLParams
  8775. ctx_ context.Context
  8776. header_ http.Header
  8777. }
  8778. // Delete: Deletes the cluster, including the Kubernetes endpoint and
  8779. // all worker
  8780. // nodes.
  8781. //
  8782. // Firewalls and routes that were configured during cluster creation
  8783. // are also deleted.
  8784. //
  8785. // Other Google Compute Engine resources that might be in use by the
  8786. // cluster,
  8787. // such as load balancer resources, are not deleted if they weren't
  8788. // present
  8789. // when the cluster was initially created.
  8790. func (r *ProjectsZonesClustersService) Delete(projectId string, zone string, clusterId string) *ProjectsZonesClustersDeleteCall {
  8791. c := &ProjectsZonesClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8792. c.projectId = projectId
  8793. c.zone = zone
  8794. c.clusterId = clusterId
  8795. return c
  8796. }
  8797. // Name sets the optional parameter "name": The name (project, location,
  8798. // cluster) of the cluster to delete.
  8799. // Specified in the format 'projects/*/locations/*/clusters/*'.
  8800. func (c *ProjectsZonesClustersDeleteCall) Name(name string) *ProjectsZonesClustersDeleteCall {
  8801. c.urlParams_.Set("name", name)
  8802. return c
  8803. }
  8804. // Fields allows partial responses to be retrieved. See
  8805. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8806. // for more information.
  8807. func (c *ProjectsZonesClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersDeleteCall {
  8808. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8809. return c
  8810. }
  8811. // Context sets the context to be used in this call's Do method. Any
  8812. // pending HTTP request will be aborted if the provided context is
  8813. // canceled.
  8814. func (c *ProjectsZonesClustersDeleteCall) Context(ctx context.Context) *ProjectsZonesClustersDeleteCall {
  8815. c.ctx_ = ctx
  8816. return c
  8817. }
  8818. // Header returns an http.Header that can be modified by the caller to
  8819. // add HTTP headers to the request.
  8820. func (c *ProjectsZonesClustersDeleteCall) Header() http.Header {
  8821. if c.header_ == nil {
  8822. c.header_ = make(http.Header)
  8823. }
  8824. return c.header_
  8825. }
  8826. func (c *ProjectsZonesClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  8827. reqHeaders := make(http.Header)
  8828. for k, v := range c.header_ {
  8829. reqHeaders[k] = v
  8830. }
  8831. reqHeaders.Set("User-Agent", c.s.userAgent())
  8832. var body io.Reader = nil
  8833. c.urlParams_.Set("alt", alt)
  8834. c.urlParams_.Set("prettyPrint", "false")
  8835. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  8836. urls += "?" + c.urlParams_.Encode()
  8837. req, err := http.NewRequest("DELETE", urls, body)
  8838. if err != nil {
  8839. return nil, err
  8840. }
  8841. req.Header = reqHeaders
  8842. googleapi.Expand(req.URL, map[string]string{
  8843. "projectId": c.projectId,
  8844. "zone": c.zone,
  8845. "clusterId": c.clusterId,
  8846. })
  8847. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8848. }
  8849. // Do executes the "container.projects.zones.clusters.delete" call.
  8850. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8851. // status code is an error. Response headers are in either
  8852. // *Operation.ServerResponse.Header or (if a response was returned at
  8853. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8854. // to check whether the returned error was because
  8855. // http.StatusNotModified was returned.
  8856. func (c *ProjectsZonesClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8857. gensupport.SetOptions(c.urlParams_, opts...)
  8858. res, err := c.doRequest("json")
  8859. if res != nil && res.StatusCode == http.StatusNotModified {
  8860. if res.Body != nil {
  8861. res.Body.Close()
  8862. }
  8863. return nil, &googleapi.Error{
  8864. Code: res.StatusCode,
  8865. Header: res.Header,
  8866. }
  8867. }
  8868. if err != nil {
  8869. return nil, err
  8870. }
  8871. defer googleapi.CloseBody(res)
  8872. if err := googleapi.CheckResponse(res); err != nil {
  8873. return nil, err
  8874. }
  8875. ret := &Operation{
  8876. ServerResponse: googleapi.ServerResponse{
  8877. Header: res.Header,
  8878. HTTPStatusCode: res.StatusCode,
  8879. },
  8880. }
  8881. target := &ret
  8882. if err := gensupport.DecodeResponse(target, res); err != nil {
  8883. return nil, err
  8884. }
  8885. return ret, nil
  8886. // {
  8887. // "description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster,\nsuch as load balancer resources, are not deleted if they weren't present\nwhen the cluster was initially created.",
  8888. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  8889. // "httpMethod": "DELETE",
  8890. // "id": "container.projects.zones.clusters.delete",
  8891. // "parameterOrder": [
  8892. // "projectId",
  8893. // "zone",
  8894. // "clusterId"
  8895. // ],
  8896. // "parameters": {
  8897. // "clusterId": {
  8898. // "description": "Deprecated. The name of the cluster to delete.\nThis field has been deprecated and replaced by the name field.",
  8899. // "location": "path",
  8900. // "required": true,
  8901. // "type": "string"
  8902. // },
  8903. // "name": {
  8904. // "description": "The name (project, location, cluster) of the cluster to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  8905. // "location": "query",
  8906. // "type": "string"
  8907. // },
  8908. // "projectId": {
  8909. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  8910. // "location": "path",
  8911. // "required": true,
  8912. // "type": "string"
  8913. // },
  8914. // "zone": {
  8915. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  8916. // "location": "path",
  8917. // "required": true,
  8918. // "type": "string"
  8919. // }
  8920. // },
  8921. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  8922. // "response": {
  8923. // "$ref": "Operation"
  8924. // },
  8925. // "scopes": [
  8926. // "https://www.googleapis.com/auth/cloud-platform"
  8927. // ]
  8928. // }
  8929. }
  8930. // method id "container.projects.zones.clusters.get":
  8931. type ProjectsZonesClustersGetCall struct {
  8932. s *Service
  8933. projectId string
  8934. zone string
  8935. clusterId string
  8936. urlParams_ gensupport.URLParams
  8937. ifNoneMatch_ string
  8938. ctx_ context.Context
  8939. header_ http.Header
  8940. }
  8941. // Get: Gets the details of a specific cluster.
  8942. func (r *ProjectsZonesClustersService) Get(projectId string, zone string, clusterId string) *ProjectsZonesClustersGetCall {
  8943. c := &ProjectsZonesClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8944. c.projectId = projectId
  8945. c.zone = zone
  8946. c.clusterId = clusterId
  8947. return c
  8948. }
  8949. // Name sets the optional parameter "name": The name (project, location,
  8950. // cluster) of the cluster to retrieve.
  8951. // Specified in the format 'projects/*/locations/*/clusters/*'.
  8952. func (c *ProjectsZonesClustersGetCall) Name(name string) *ProjectsZonesClustersGetCall {
  8953. c.urlParams_.Set("name", name)
  8954. return c
  8955. }
  8956. // Fields allows partial responses to be retrieved. See
  8957. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8958. // for more information.
  8959. func (c *ProjectsZonesClustersGetCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersGetCall {
  8960. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8961. return c
  8962. }
  8963. // IfNoneMatch sets the optional parameter which makes the operation
  8964. // fail if the object's ETag matches the given value. This is useful for
  8965. // getting updates only after the object has changed since the last
  8966. // request. Use googleapi.IsNotModified to check whether the response
  8967. // error from Do is the result of In-None-Match.
  8968. func (c *ProjectsZonesClustersGetCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersGetCall {
  8969. c.ifNoneMatch_ = entityTag
  8970. return c
  8971. }
  8972. // Context sets the context to be used in this call's Do method. Any
  8973. // pending HTTP request will be aborted if the provided context is
  8974. // canceled.
  8975. func (c *ProjectsZonesClustersGetCall) Context(ctx context.Context) *ProjectsZonesClustersGetCall {
  8976. c.ctx_ = ctx
  8977. return c
  8978. }
  8979. // Header returns an http.Header that can be modified by the caller to
  8980. // add HTTP headers to the request.
  8981. func (c *ProjectsZonesClustersGetCall) Header() http.Header {
  8982. if c.header_ == nil {
  8983. c.header_ = make(http.Header)
  8984. }
  8985. return c.header_
  8986. }
  8987. func (c *ProjectsZonesClustersGetCall) doRequest(alt string) (*http.Response, error) {
  8988. reqHeaders := make(http.Header)
  8989. for k, v := range c.header_ {
  8990. reqHeaders[k] = v
  8991. }
  8992. reqHeaders.Set("User-Agent", c.s.userAgent())
  8993. if c.ifNoneMatch_ != "" {
  8994. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8995. }
  8996. var body io.Reader = nil
  8997. c.urlParams_.Set("alt", alt)
  8998. c.urlParams_.Set("prettyPrint", "false")
  8999. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  9000. urls += "?" + c.urlParams_.Encode()
  9001. req, err := http.NewRequest("GET", urls, body)
  9002. if err != nil {
  9003. return nil, err
  9004. }
  9005. req.Header = reqHeaders
  9006. googleapi.Expand(req.URL, map[string]string{
  9007. "projectId": c.projectId,
  9008. "zone": c.zone,
  9009. "clusterId": c.clusterId,
  9010. })
  9011. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9012. }
  9013. // Do executes the "container.projects.zones.clusters.get" call.
  9014. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  9015. // code is an error. Response headers are in either
  9016. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  9017. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9018. // check whether the returned error was because http.StatusNotModified
  9019. // was returned.
  9020. func (c *ProjectsZonesClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  9021. gensupport.SetOptions(c.urlParams_, opts...)
  9022. res, err := c.doRequest("json")
  9023. if res != nil && res.StatusCode == http.StatusNotModified {
  9024. if res.Body != nil {
  9025. res.Body.Close()
  9026. }
  9027. return nil, &googleapi.Error{
  9028. Code: res.StatusCode,
  9029. Header: res.Header,
  9030. }
  9031. }
  9032. if err != nil {
  9033. return nil, err
  9034. }
  9035. defer googleapi.CloseBody(res)
  9036. if err := googleapi.CheckResponse(res); err != nil {
  9037. return nil, err
  9038. }
  9039. ret := &Cluster{
  9040. ServerResponse: googleapi.ServerResponse{
  9041. Header: res.Header,
  9042. HTTPStatusCode: res.StatusCode,
  9043. },
  9044. }
  9045. target := &ret
  9046. if err := gensupport.DecodeResponse(target, res); err != nil {
  9047. return nil, err
  9048. }
  9049. return ret, nil
  9050. // {
  9051. // "description": "Gets the details of a specific cluster.",
  9052. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  9053. // "httpMethod": "GET",
  9054. // "id": "container.projects.zones.clusters.get",
  9055. // "parameterOrder": [
  9056. // "projectId",
  9057. // "zone",
  9058. // "clusterId"
  9059. // ],
  9060. // "parameters": {
  9061. // "clusterId": {
  9062. // "description": "Deprecated. The name of the cluster to retrieve.\nThis field has been deprecated and replaced by the name field.",
  9063. // "location": "path",
  9064. // "required": true,
  9065. // "type": "string"
  9066. // },
  9067. // "name": {
  9068. // "description": "The name (project, location, cluster) of the cluster to retrieve.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  9069. // "location": "query",
  9070. // "type": "string"
  9071. // },
  9072. // "projectId": {
  9073. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  9074. // "location": "path",
  9075. // "required": true,
  9076. // "type": "string"
  9077. // },
  9078. // "zone": {
  9079. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  9080. // "location": "path",
  9081. // "required": true,
  9082. // "type": "string"
  9083. // }
  9084. // },
  9085. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  9086. // "response": {
  9087. // "$ref": "Cluster"
  9088. // },
  9089. // "scopes": [
  9090. // "https://www.googleapis.com/auth/cloud-platform"
  9091. // ]
  9092. // }
  9093. }
  9094. // method id "container.projects.zones.clusters.legacyAbac":
  9095. type ProjectsZonesClustersLegacyAbacCall struct {
  9096. s *Service
  9097. projectId string
  9098. zone string
  9099. clusterId string
  9100. setlegacyabacrequest *SetLegacyAbacRequest
  9101. urlParams_ gensupport.URLParams
  9102. ctx_ context.Context
  9103. header_ http.Header
  9104. }
  9105. // LegacyAbac: Enables or disables the ABAC authorization mechanism on a
  9106. // cluster.
  9107. func (r *ProjectsZonesClustersService) LegacyAbac(projectId string, zone string, clusterId string, setlegacyabacrequest *SetLegacyAbacRequest) *ProjectsZonesClustersLegacyAbacCall {
  9108. c := &ProjectsZonesClustersLegacyAbacCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9109. c.projectId = projectId
  9110. c.zone = zone
  9111. c.clusterId = clusterId
  9112. c.setlegacyabacrequest = setlegacyabacrequest
  9113. return c
  9114. }
  9115. // Fields allows partial responses to be retrieved. See
  9116. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9117. // for more information.
  9118. func (c *ProjectsZonesClustersLegacyAbacCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersLegacyAbacCall {
  9119. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9120. return c
  9121. }
  9122. // Context sets the context to be used in this call's Do method. Any
  9123. // pending HTTP request will be aborted if the provided context is
  9124. // canceled.
  9125. func (c *ProjectsZonesClustersLegacyAbacCall) Context(ctx context.Context) *ProjectsZonesClustersLegacyAbacCall {
  9126. c.ctx_ = ctx
  9127. return c
  9128. }
  9129. // Header returns an http.Header that can be modified by the caller to
  9130. // add HTTP headers to the request.
  9131. func (c *ProjectsZonesClustersLegacyAbacCall) Header() http.Header {
  9132. if c.header_ == nil {
  9133. c.header_ = make(http.Header)
  9134. }
  9135. return c.header_
  9136. }
  9137. func (c *ProjectsZonesClustersLegacyAbacCall) doRequest(alt string) (*http.Response, error) {
  9138. reqHeaders := make(http.Header)
  9139. for k, v := range c.header_ {
  9140. reqHeaders[k] = v
  9141. }
  9142. reqHeaders.Set("User-Agent", c.s.userAgent())
  9143. var body io.Reader = nil
  9144. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlegacyabacrequest)
  9145. if err != nil {
  9146. return nil, err
  9147. }
  9148. reqHeaders.Set("Content-Type", "application/json")
  9149. c.urlParams_.Set("alt", alt)
  9150. c.urlParams_.Set("prettyPrint", "false")
  9151. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac")
  9152. urls += "?" + c.urlParams_.Encode()
  9153. req, err := http.NewRequest("POST", urls, body)
  9154. if err != nil {
  9155. return nil, err
  9156. }
  9157. req.Header = reqHeaders
  9158. googleapi.Expand(req.URL, map[string]string{
  9159. "projectId": c.projectId,
  9160. "zone": c.zone,
  9161. "clusterId": c.clusterId,
  9162. })
  9163. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9164. }
  9165. // Do executes the "container.projects.zones.clusters.legacyAbac" call.
  9166. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9167. // status code is an error. Response headers are in either
  9168. // *Operation.ServerResponse.Header or (if a response was returned at
  9169. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9170. // to check whether the returned error was because
  9171. // http.StatusNotModified was returned.
  9172. func (c *ProjectsZonesClustersLegacyAbacCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9173. gensupport.SetOptions(c.urlParams_, opts...)
  9174. res, err := c.doRequest("json")
  9175. if res != nil && res.StatusCode == http.StatusNotModified {
  9176. if res.Body != nil {
  9177. res.Body.Close()
  9178. }
  9179. return nil, &googleapi.Error{
  9180. Code: res.StatusCode,
  9181. Header: res.Header,
  9182. }
  9183. }
  9184. if err != nil {
  9185. return nil, err
  9186. }
  9187. defer googleapi.CloseBody(res)
  9188. if err := googleapi.CheckResponse(res); err != nil {
  9189. return nil, err
  9190. }
  9191. ret := &Operation{
  9192. ServerResponse: googleapi.ServerResponse{
  9193. Header: res.Header,
  9194. HTTPStatusCode: res.StatusCode,
  9195. },
  9196. }
  9197. target := &ret
  9198. if err := gensupport.DecodeResponse(target, res); err != nil {
  9199. return nil, err
  9200. }
  9201. return ret, nil
  9202. // {
  9203. // "description": "Enables or disables the ABAC authorization mechanism on a cluster.",
  9204. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac",
  9205. // "httpMethod": "POST",
  9206. // "id": "container.projects.zones.clusters.legacyAbac",
  9207. // "parameterOrder": [
  9208. // "projectId",
  9209. // "zone",
  9210. // "clusterId"
  9211. // ],
  9212. // "parameters": {
  9213. // "clusterId": {
  9214. // "description": "Deprecated. The name of the cluster to update.\nThis field has been deprecated and replaced by the name field.",
  9215. // "location": "path",
  9216. // "required": true,
  9217. // "type": "string"
  9218. // },
  9219. // "projectId": {
  9220. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  9221. // "location": "path",
  9222. // "required": true,
  9223. // "type": "string"
  9224. // },
  9225. // "zone": {
  9226. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  9227. // "location": "path",
  9228. // "required": true,
  9229. // "type": "string"
  9230. // }
  9231. // },
  9232. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac",
  9233. // "request": {
  9234. // "$ref": "SetLegacyAbacRequest"
  9235. // },
  9236. // "response": {
  9237. // "$ref": "Operation"
  9238. // },
  9239. // "scopes": [
  9240. // "https://www.googleapis.com/auth/cloud-platform"
  9241. // ]
  9242. // }
  9243. }
  9244. // method id "container.projects.zones.clusters.list":
  9245. type ProjectsZonesClustersListCall struct {
  9246. s *Service
  9247. projectId string
  9248. zone string
  9249. urlParams_ gensupport.URLParams
  9250. ifNoneMatch_ string
  9251. ctx_ context.Context
  9252. header_ http.Header
  9253. }
  9254. // List: Lists all clusters owned by a project in either the specified
  9255. // zone or all
  9256. // zones.
  9257. func (r *ProjectsZonesClustersService) List(projectId string, zone string) *ProjectsZonesClustersListCall {
  9258. c := &ProjectsZonesClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9259. c.projectId = projectId
  9260. c.zone = zone
  9261. return c
  9262. }
  9263. // Parent sets the optional parameter "parent": The parent (project and
  9264. // location) where the clusters will be listed.
  9265. // Specified in the format 'projects/*/locations/*'.
  9266. // Location "-" matches all zones and all regions.
  9267. func (c *ProjectsZonesClustersListCall) Parent(parent string) *ProjectsZonesClustersListCall {
  9268. c.urlParams_.Set("parent", parent)
  9269. return c
  9270. }
  9271. // Fields allows partial responses to be retrieved. See
  9272. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9273. // for more information.
  9274. func (c *ProjectsZonesClustersListCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersListCall {
  9275. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9276. return c
  9277. }
  9278. // IfNoneMatch sets the optional parameter which makes the operation
  9279. // fail if the object's ETag matches the given value. This is useful for
  9280. // getting updates only after the object has changed since the last
  9281. // request. Use googleapi.IsNotModified to check whether the response
  9282. // error from Do is the result of In-None-Match.
  9283. func (c *ProjectsZonesClustersListCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersListCall {
  9284. c.ifNoneMatch_ = entityTag
  9285. return c
  9286. }
  9287. // Context sets the context to be used in this call's Do method. Any
  9288. // pending HTTP request will be aborted if the provided context is
  9289. // canceled.
  9290. func (c *ProjectsZonesClustersListCall) Context(ctx context.Context) *ProjectsZonesClustersListCall {
  9291. c.ctx_ = ctx
  9292. return c
  9293. }
  9294. // Header returns an http.Header that can be modified by the caller to
  9295. // add HTTP headers to the request.
  9296. func (c *ProjectsZonesClustersListCall) Header() http.Header {
  9297. if c.header_ == nil {
  9298. c.header_ = make(http.Header)
  9299. }
  9300. return c.header_
  9301. }
  9302. func (c *ProjectsZonesClustersListCall) doRequest(alt string) (*http.Response, error) {
  9303. reqHeaders := make(http.Header)
  9304. for k, v := range c.header_ {
  9305. reqHeaders[k] = v
  9306. }
  9307. reqHeaders.Set("User-Agent", c.s.userAgent())
  9308. if c.ifNoneMatch_ != "" {
  9309. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9310. }
  9311. var body io.Reader = nil
  9312. c.urlParams_.Set("alt", alt)
  9313. c.urlParams_.Set("prettyPrint", "false")
  9314. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters")
  9315. urls += "?" + c.urlParams_.Encode()
  9316. req, err := http.NewRequest("GET", urls, body)
  9317. if err != nil {
  9318. return nil, err
  9319. }
  9320. req.Header = reqHeaders
  9321. googleapi.Expand(req.URL, map[string]string{
  9322. "projectId": c.projectId,
  9323. "zone": c.zone,
  9324. })
  9325. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9326. }
  9327. // Do executes the "container.projects.zones.clusters.list" call.
  9328. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  9329. // non-2xx status code is an error. Response headers are in either
  9330. // *ListClustersResponse.ServerResponse.Header or (if a response was
  9331. // returned at all) in error.(*googleapi.Error).Header. Use
  9332. // googleapi.IsNotModified to check whether the returned error was
  9333. // because http.StatusNotModified was returned.
  9334. func (c *ProjectsZonesClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  9335. gensupport.SetOptions(c.urlParams_, opts...)
  9336. res, err := c.doRequest("json")
  9337. if res != nil && res.StatusCode == http.StatusNotModified {
  9338. if res.Body != nil {
  9339. res.Body.Close()
  9340. }
  9341. return nil, &googleapi.Error{
  9342. Code: res.StatusCode,
  9343. Header: res.Header,
  9344. }
  9345. }
  9346. if err != nil {
  9347. return nil, err
  9348. }
  9349. defer googleapi.CloseBody(res)
  9350. if err := googleapi.CheckResponse(res); err != nil {
  9351. return nil, err
  9352. }
  9353. ret := &ListClustersResponse{
  9354. ServerResponse: googleapi.ServerResponse{
  9355. Header: res.Header,
  9356. HTTPStatusCode: res.StatusCode,
  9357. },
  9358. }
  9359. target := &ret
  9360. if err := gensupport.DecodeResponse(target, res); err != nil {
  9361. return nil, err
  9362. }
  9363. return ret, nil
  9364. // {
  9365. // "description": "Lists all clusters owned by a project in either the specified zone or all\nzones.",
  9366. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters",
  9367. // "httpMethod": "GET",
  9368. // "id": "container.projects.zones.clusters.list",
  9369. // "parameterOrder": [
  9370. // "projectId",
  9371. // "zone"
  9372. // ],
  9373. // "parameters": {
  9374. // "parent": {
  9375. // "description": "The parent (project and location) where the clusters will be listed.\nSpecified in the format 'projects/*/locations/*'.\nLocation \"-\" matches all zones and all regions.",
  9376. // "location": "query",
  9377. // "type": "string"
  9378. // },
  9379. // "projectId": {
  9380. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the parent field.",
  9381. // "location": "path",
  9382. // "required": true,
  9383. // "type": "string"
  9384. // },
  9385. // "zone": {
  9386. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides, or \"-\" for all zones.\nThis field has been deprecated and replaced by the parent field.",
  9387. // "location": "path",
  9388. // "required": true,
  9389. // "type": "string"
  9390. // }
  9391. // },
  9392. // "path": "v1/projects/{projectId}/zones/{zone}/clusters",
  9393. // "response": {
  9394. // "$ref": "ListClustersResponse"
  9395. // },
  9396. // "scopes": [
  9397. // "https://www.googleapis.com/auth/cloud-platform"
  9398. // ]
  9399. // }
  9400. }
  9401. // method id "container.projects.zones.clusters.locations":
  9402. type ProjectsZonesClustersLocationsCall struct {
  9403. s *Service
  9404. projectId string
  9405. zone string
  9406. clusterId string
  9407. setlocationsrequest *SetLocationsRequest
  9408. urlParams_ gensupport.URLParams
  9409. ctx_ context.Context
  9410. header_ http.Header
  9411. }
  9412. // Locations: Sets the locations for a specific cluster.
  9413. func (r *ProjectsZonesClustersService) Locations(projectId string, zone string, clusterId string, setlocationsrequest *SetLocationsRequest) *ProjectsZonesClustersLocationsCall {
  9414. c := &ProjectsZonesClustersLocationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9415. c.projectId = projectId
  9416. c.zone = zone
  9417. c.clusterId = clusterId
  9418. c.setlocationsrequest = setlocationsrequest
  9419. return c
  9420. }
  9421. // Fields allows partial responses to be retrieved. See
  9422. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9423. // for more information.
  9424. func (c *ProjectsZonesClustersLocationsCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersLocationsCall {
  9425. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9426. return c
  9427. }
  9428. // Context sets the context to be used in this call's Do method. Any
  9429. // pending HTTP request will be aborted if the provided context is
  9430. // canceled.
  9431. func (c *ProjectsZonesClustersLocationsCall) Context(ctx context.Context) *ProjectsZonesClustersLocationsCall {
  9432. c.ctx_ = ctx
  9433. return c
  9434. }
  9435. // Header returns an http.Header that can be modified by the caller to
  9436. // add HTTP headers to the request.
  9437. func (c *ProjectsZonesClustersLocationsCall) Header() http.Header {
  9438. if c.header_ == nil {
  9439. c.header_ = make(http.Header)
  9440. }
  9441. return c.header_
  9442. }
  9443. func (c *ProjectsZonesClustersLocationsCall) doRequest(alt string) (*http.Response, error) {
  9444. reqHeaders := make(http.Header)
  9445. for k, v := range c.header_ {
  9446. reqHeaders[k] = v
  9447. }
  9448. reqHeaders.Set("User-Agent", c.s.userAgent())
  9449. var body io.Reader = nil
  9450. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlocationsrequest)
  9451. if err != nil {
  9452. return nil, err
  9453. }
  9454. reqHeaders.Set("Content-Type", "application/json")
  9455. c.urlParams_.Set("alt", alt)
  9456. c.urlParams_.Set("prettyPrint", "false")
  9457. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations")
  9458. urls += "?" + c.urlParams_.Encode()
  9459. req, err := http.NewRequest("POST", urls, body)
  9460. if err != nil {
  9461. return nil, err
  9462. }
  9463. req.Header = reqHeaders
  9464. googleapi.Expand(req.URL, map[string]string{
  9465. "projectId": c.projectId,
  9466. "zone": c.zone,
  9467. "clusterId": c.clusterId,
  9468. })
  9469. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9470. }
  9471. // Do executes the "container.projects.zones.clusters.locations" call.
  9472. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9473. // status code is an error. Response headers are in either
  9474. // *Operation.ServerResponse.Header or (if a response was returned at
  9475. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9476. // to check whether the returned error was because
  9477. // http.StatusNotModified was returned.
  9478. func (c *ProjectsZonesClustersLocationsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9479. gensupport.SetOptions(c.urlParams_, opts...)
  9480. res, err := c.doRequest("json")
  9481. if res != nil && res.StatusCode == http.StatusNotModified {
  9482. if res.Body != nil {
  9483. res.Body.Close()
  9484. }
  9485. return nil, &googleapi.Error{
  9486. Code: res.StatusCode,
  9487. Header: res.Header,
  9488. }
  9489. }
  9490. if err != nil {
  9491. return nil, err
  9492. }
  9493. defer googleapi.CloseBody(res)
  9494. if err := googleapi.CheckResponse(res); err != nil {
  9495. return nil, err
  9496. }
  9497. ret := &Operation{
  9498. ServerResponse: googleapi.ServerResponse{
  9499. Header: res.Header,
  9500. HTTPStatusCode: res.StatusCode,
  9501. },
  9502. }
  9503. target := &ret
  9504. if err := gensupport.DecodeResponse(target, res); err != nil {
  9505. return nil, err
  9506. }
  9507. return ret, nil
  9508. // {
  9509. // "description": "Sets the locations for a specific cluster.",
  9510. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations",
  9511. // "httpMethod": "POST",
  9512. // "id": "container.projects.zones.clusters.locations",
  9513. // "parameterOrder": [
  9514. // "projectId",
  9515. // "zone",
  9516. // "clusterId"
  9517. // ],
  9518. // "parameters": {
  9519. // "clusterId": {
  9520. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9521. // "location": "path",
  9522. // "required": true,
  9523. // "type": "string"
  9524. // },
  9525. // "projectId": {
  9526. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  9527. // "location": "path",
  9528. // "required": true,
  9529. // "type": "string"
  9530. // },
  9531. // "zone": {
  9532. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  9533. // "location": "path",
  9534. // "required": true,
  9535. // "type": "string"
  9536. // }
  9537. // },
  9538. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations",
  9539. // "request": {
  9540. // "$ref": "SetLocationsRequest"
  9541. // },
  9542. // "response": {
  9543. // "$ref": "Operation"
  9544. // },
  9545. // "scopes": [
  9546. // "https://www.googleapis.com/auth/cloud-platform"
  9547. // ]
  9548. // }
  9549. }
  9550. // method id "container.projects.zones.clusters.logging":
  9551. type ProjectsZonesClustersLoggingCall struct {
  9552. s *Service
  9553. projectId string
  9554. zone string
  9555. clusterId string
  9556. setloggingservicerequest *SetLoggingServiceRequest
  9557. urlParams_ gensupport.URLParams
  9558. ctx_ context.Context
  9559. header_ http.Header
  9560. }
  9561. // Logging: Sets the logging service for a specific cluster.
  9562. func (r *ProjectsZonesClustersService) Logging(projectId string, zone string, clusterId string, setloggingservicerequest *SetLoggingServiceRequest) *ProjectsZonesClustersLoggingCall {
  9563. c := &ProjectsZonesClustersLoggingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9564. c.projectId = projectId
  9565. c.zone = zone
  9566. c.clusterId = clusterId
  9567. c.setloggingservicerequest = setloggingservicerequest
  9568. return c
  9569. }
  9570. // Fields allows partial responses to be retrieved. See
  9571. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9572. // for more information.
  9573. func (c *ProjectsZonesClustersLoggingCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersLoggingCall {
  9574. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9575. return c
  9576. }
  9577. // Context sets the context to be used in this call's Do method. Any
  9578. // pending HTTP request will be aborted if the provided context is
  9579. // canceled.
  9580. func (c *ProjectsZonesClustersLoggingCall) Context(ctx context.Context) *ProjectsZonesClustersLoggingCall {
  9581. c.ctx_ = ctx
  9582. return c
  9583. }
  9584. // Header returns an http.Header that can be modified by the caller to
  9585. // add HTTP headers to the request.
  9586. func (c *ProjectsZonesClustersLoggingCall) Header() http.Header {
  9587. if c.header_ == nil {
  9588. c.header_ = make(http.Header)
  9589. }
  9590. return c.header_
  9591. }
  9592. func (c *ProjectsZonesClustersLoggingCall) doRequest(alt string) (*http.Response, error) {
  9593. reqHeaders := make(http.Header)
  9594. for k, v := range c.header_ {
  9595. reqHeaders[k] = v
  9596. }
  9597. reqHeaders.Set("User-Agent", c.s.userAgent())
  9598. var body io.Reader = nil
  9599. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setloggingservicerequest)
  9600. if err != nil {
  9601. return nil, err
  9602. }
  9603. reqHeaders.Set("Content-Type", "application/json")
  9604. c.urlParams_.Set("alt", alt)
  9605. c.urlParams_.Set("prettyPrint", "false")
  9606. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging")
  9607. urls += "?" + c.urlParams_.Encode()
  9608. req, err := http.NewRequest("POST", urls, body)
  9609. if err != nil {
  9610. return nil, err
  9611. }
  9612. req.Header = reqHeaders
  9613. googleapi.Expand(req.URL, map[string]string{
  9614. "projectId": c.projectId,
  9615. "zone": c.zone,
  9616. "clusterId": c.clusterId,
  9617. })
  9618. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9619. }
  9620. // Do executes the "container.projects.zones.clusters.logging" call.
  9621. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9622. // status code is an error. Response headers are in either
  9623. // *Operation.ServerResponse.Header or (if a response was returned at
  9624. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9625. // to check whether the returned error was because
  9626. // http.StatusNotModified was returned.
  9627. func (c *ProjectsZonesClustersLoggingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9628. gensupport.SetOptions(c.urlParams_, opts...)
  9629. res, err := c.doRequest("json")
  9630. if res != nil && res.StatusCode == http.StatusNotModified {
  9631. if res.Body != nil {
  9632. res.Body.Close()
  9633. }
  9634. return nil, &googleapi.Error{
  9635. Code: res.StatusCode,
  9636. Header: res.Header,
  9637. }
  9638. }
  9639. if err != nil {
  9640. return nil, err
  9641. }
  9642. defer googleapi.CloseBody(res)
  9643. if err := googleapi.CheckResponse(res); err != nil {
  9644. return nil, err
  9645. }
  9646. ret := &Operation{
  9647. ServerResponse: googleapi.ServerResponse{
  9648. Header: res.Header,
  9649. HTTPStatusCode: res.StatusCode,
  9650. },
  9651. }
  9652. target := &ret
  9653. if err := gensupport.DecodeResponse(target, res); err != nil {
  9654. return nil, err
  9655. }
  9656. return ret, nil
  9657. // {
  9658. // "description": "Sets the logging service for a specific cluster.",
  9659. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging",
  9660. // "httpMethod": "POST",
  9661. // "id": "container.projects.zones.clusters.logging",
  9662. // "parameterOrder": [
  9663. // "projectId",
  9664. // "zone",
  9665. // "clusterId"
  9666. // ],
  9667. // "parameters": {
  9668. // "clusterId": {
  9669. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9670. // "location": "path",
  9671. // "required": true,
  9672. // "type": "string"
  9673. // },
  9674. // "projectId": {
  9675. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  9676. // "location": "path",
  9677. // "required": true,
  9678. // "type": "string"
  9679. // },
  9680. // "zone": {
  9681. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  9682. // "location": "path",
  9683. // "required": true,
  9684. // "type": "string"
  9685. // }
  9686. // },
  9687. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging",
  9688. // "request": {
  9689. // "$ref": "SetLoggingServiceRequest"
  9690. // },
  9691. // "response": {
  9692. // "$ref": "Operation"
  9693. // },
  9694. // "scopes": [
  9695. // "https://www.googleapis.com/auth/cloud-platform"
  9696. // ]
  9697. // }
  9698. }
  9699. // method id "container.projects.zones.clusters.master":
  9700. type ProjectsZonesClustersMasterCall struct {
  9701. s *Service
  9702. projectId string
  9703. zone string
  9704. clusterId string
  9705. updatemasterrequest *UpdateMasterRequest
  9706. urlParams_ gensupport.URLParams
  9707. ctx_ context.Context
  9708. header_ http.Header
  9709. }
  9710. // Master: Updates the master for a specific cluster.
  9711. func (r *ProjectsZonesClustersService) Master(projectId string, zone string, clusterId string, updatemasterrequest *UpdateMasterRequest) *ProjectsZonesClustersMasterCall {
  9712. c := &ProjectsZonesClustersMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9713. c.projectId = projectId
  9714. c.zone = zone
  9715. c.clusterId = clusterId
  9716. c.updatemasterrequest = updatemasterrequest
  9717. return c
  9718. }
  9719. // Fields allows partial responses to be retrieved. See
  9720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9721. // for more information.
  9722. func (c *ProjectsZonesClustersMasterCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersMasterCall {
  9723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9724. return c
  9725. }
  9726. // Context sets the context to be used in this call's Do method. Any
  9727. // pending HTTP request will be aborted if the provided context is
  9728. // canceled.
  9729. func (c *ProjectsZonesClustersMasterCall) Context(ctx context.Context) *ProjectsZonesClustersMasterCall {
  9730. c.ctx_ = ctx
  9731. return c
  9732. }
  9733. // Header returns an http.Header that can be modified by the caller to
  9734. // add HTTP headers to the request.
  9735. func (c *ProjectsZonesClustersMasterCall) Header() http.Header {
  9736. if c.header_ == nil {
  9737. c.header_ = make(http.Header)
  9738. }
  9739. return c.header_
  9740. }
  9741. func (c *ProjectsZonesClustersMasterCall) doRequest(alt string) (*http.Response, error) {
  9742. reqHeaders := make(http.Header)
  9743. for k, v := range c.header_ {
  9744. reqHeaders[k] = v
  9745. }
  9746. reqHeaders.Set("User-Agent", c.s.userAgent())
  9747. var body io.Reader = nil
  9748. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatemasterrequest)
  9749. if err != nil {
  9750. return nil, err
  9751. }
  9752. reqHeaders.Set("Content-Type", "application/json")
  9753. c.urlParams_.Set("alt", alt)
  9754. c.urlParams_.Set("prettyPrint", "false")
  9755. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master")
  9756. urls += "?" + c.urlParams_.Encode()
  9757. req, err := http.NewRequest("POST", urls, body)
  9758. if err != nil {
  9759. return nil, err
  9760. }
  9761. req.Header = reqHeaders
  9762. googleapi.Expand(req.URL, map[string]string{
  9763. "projectId": c.projectId,
  9764. "zone": c.zone,
  9765. "clusterId": c.clusterId,
  9766. })
  9767. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9768. }
  9769. // Do executes the "container.projects.zones.clusters.master" call.
  9770. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9771. // status code is an error. Response headers are in either
  9772. // *Operation.ServerResponse.Header or (if a response was returned at
  9773. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9774. // to check whether the returned error was because
  9775. // http.StatusNotModified was returned.
  9776. func (c *ProjectsZonesClustersMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9777. gensupport.SetOptions(c.urlParams_, opts...)
  9778. res, err := c.doRequest("json")
  9779. if res != nil && res.StatusCode == http.StatusNotModified {
  9780. if res.Body != nil {
  9781. res.Body.Close()
  9782. }
  9783. return nil, &googleapi.Error{
  9784. Code: res.StatusCode,
  9785. Header: res.Header,
  9786. }
  9787. }
  9788. if err != nil {
  9789. return nil, err
  9790. }
  9791. defer googleapi.CloseBody(res)
  9792. if err := googleapi.CheckResponse(res); err != nil {
  9793. return nil, err
  9794. }
  9795. ret := &Operation{
  9796. ServerResponse: googleapi.ServerResponse{
  9797. Header: res.Header,
  9798. HTTPStatusCode: res.StatusCode,
  9799. },
  9800. }
  9801. target := &ret
  9802. if err := gensupport.DecodeResponse(target, res); err != nil {
  9803. return nil, err
  9804. }
  9805. return ret, nil
  9806. // {
  9807. // "description": "Updates the master for a specific cluster.",
  9808. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master",
  9809. // "httpMethod": "POST",
  9810. // "id": "container.projects.zones.clusters.master",
  9811. // "parameterOrder": [
  9812. // "projectId",
  9813. // "zone",
  9814. // "clusterId"
  9815. // ],
  9816. // "parameters": {
  9817. // "clusterId": {
  9818. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9819. // "location": "path",
  9820. // "required": true,
  9821. // "type": "string"
  9822. // },
  9823. // "projectId": {
  9824. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  9825. // "location": "path",
  9826. // "required": true,
  9827. // "type": "string"
  9828. // },
  9829. // "zone": {
  9830. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  9831. // "location": "path",
  9832. // "required": true,
  9833. // "type": "string"
  9834. // }
  9835. // },
  9836. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master",
  9837. // "request": {
  9838. // "$ref": "UpdateMasterRequest"
  9839. // },
  9840. // "response": {
  9841. // "$ref": "Operation"
  9842. // },
  9843. // "scopes": [
  9844. // "https://www.googleapis.com/auth/cloud-platform"
  9845. // ]
  9846. // }
  9847. }
  9848. // method id "container.projects.zones.clusters.monitoring":
  9849. type ProjectsZonesClustersMonitoringCall struct {
  9850. s *Service
  9851. projectId string
  9852. zone string
  9853. clusterId string
  9854. setmonitoringservicerequest *SetMonitoringServiceRequest
  9855. urlParams_ gensupport.URLParams
  9856. ctx_ context.Context
  9857. header_ http.Header
  9858. }
  9859. // Monitoring: Sets the monitoring service for a specific cluster.
  9860. func (r *ProjectsZonesClustersService) Monitoring(projectId string, zone string, clusterId string, setmonitoringservicerequest *SetMonitoringServiceRequest) *ProjectsZonesClustersMonitoringCall {
  9861. c := &ProjectsZonesClustersMonitoringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9862. c.projectId = projectId
  9863. c.zone = zone
  9864. c.clusterId = clusterId
  9865. c.setmonitoringservicerequest = setmonitoringservicerequest
  9866. return c
  9867. }
  9868. // Fields allows partial responses to be retrieved. See
  9869. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9870. // for more information.
  9871. func (c *ProjectsZonesClustersMonitoringCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersMonitoringCall {
  9872. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9873. return c
  9874. }
  9875. // Context sets the context to be used in this call's Do method. Any
  9876. // pending HTTP request will be aborted if the provided context is
  9877. // canceled.
  9878. func (c *ProjectsZonesClustersMonitoringCall) Context(ctx context.Context) *ProjectsZonesClustersMonitoringCall {
  9879. c.ctx_ = ctx
  9880. return c
  9881. }
  9882. // Header returns an http.Header that can be modified by the caller to
  9883. // add HTTP headers to the request.
  9884. func (c *ProjectsZonesClustersMonitoringCall) Header() http.Header {
  9885. if c.header_ == nil {
  9886. c.header_ = make(http.Header)
  9887. }
  9888. return c.header_
  9889. }
  9890. func (c *ProjectsZonesClustersMonitoringCall) doRequest(alt string) (*http.Response, error) {
  9891. reqHeaders := make(http.Header)
  9892. for k, v := range c.header_ {
  9893. reqHeaders[k] = v
  9894. }
  9895. reqHeaders.Set("User-Agent", c.s.userAgent())
  9896. var body io.Reader = nil
  9897. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmonitoringservicerequest)
  9898. if err != nil {
  9899. return nil, err
  9900. }
  9901. reqHeaders.Set("Content-Type", "application/json")
  9902. c.urlParams_.Set("alt", alt)
  9903. c.urlParams_.Set("prettyPrint", "false")
  9904. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring")
  9905. urls += "?" + c.urlParams_.Encode()
  9906. req, err := http.NewRequest("POST", urls, body)
  9907. if err != nil {
  9908. return nil, err
  9909. }
  9910. req.Header = reqHeaders
  9911. googleapi.Expand(req.URL, map[string]string{
  9912. "projectId": c.projectId,
  9913. "zone": c.zone,
  9914. "clusterId": c.clusterId,
  9915. })
  9916. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9917. }
  9918. // Do executes the "container.projects.zones.clusters.monitoring" call.
  9919. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9920. // status code is an error. Response headers are in either
  9921. // *Operation.ServerResponse.Header or (if a response was returned at
  9922. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9923. // to check whether the returned error was because
  9924. // http.StatusNotModified was returned.
  9925. func (c *ProjectsZonesClustersMonitoringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9926. gensupport.SetOptions(c.urlParams_, opts...)
  9927. res, err := c.doRequest("json")
  9928. if res != nil && res.StatusCode == http.StatusNotModified {
  9929. if res.Body != nil {
  9930. res.Body.Close()
  9931. }
  9932. return nil, &googleapi.Error{
  9933. Code: res.StatusCode,
  9934. Header: res.Header,
  9935. }
  9936. }
  9937. if err != nil {
  9938. return nil, err
  9939. }
  9940. defer googleapi.CloseBody(res)
  9941. if err := googleapi.CheckResponse(res); err != nil {
  9942. return nil, err
  9943. }
  9944. ret := &Operation{
  9945. ServerResponse: googleapi.ServerResponse{
  9946. Header: res.Header,
  9947. HTTPStatusCode: res.StatusCode,
  9948. },
  9949. }
  9950. target := &ret
  9951. if err := gensupport.DecodeResponse(target, res); err != nil {
  9952. return nil, err
  9953. }
  9954. return ret, nil
  9955. // {
  9956. // "description": "Sets the monitoring service for a specific cluster.",
  9957. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring",
  9958. // "httpMethod": "POST",
  9959. // "id": "container.projects.zones.clusters.monitoring",
  9960. // "parameterOrder": [
  9961. // "projectId",
  9962. // "zone",
  9963. // "clusterId"
  9964. // ],
  9965. // "parameters": {
  9966. // "clusterId": {
  9967. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9968. // "location": "path",
  9969. // "required": true,
  9970. // "type": "string"
  9971. // },
  9972. // "projectId": {
  9973. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  9974. // "location": "path",
  9975. // "required": true,
  9976. // "type": "string"
  9977. // },
  9978. // "zone": {
  9979. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  9980. // "location": "path",
  9981. // "required": true,
  9982. // "type": "string"
  9983. // }
  9984. // },
  9985. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring",
  9986. // "request": {
  9987. // "$ref": "SetMonitoringServiceRequest"
  9988. // },
  9989. // "response": {
  9990. // "$ref": "Operation"
  9991. // },
  9992. // "scopes": [
  9993. // "https://www.googleapis.com/auth/cloud-platform"
  9994. // ]
  9995. // }
  9996. }
  9997. // method id "container.projects.zones.clusters.resourceLabels":
  9998. type ProjectsZonesClustersResourceLabelsCall struct {
  9999. s *Service
  10000. projectId string
  10001. zone string
  10002. clusterId string
  10003. setlabelsrequest *SetLabelsRequest
  10004. urlParams_ gensupport.URLParams
  10005. ctx_ context.Context
  10006. header_ http.Header
  10007. }
  10008. // ResourceLabels: Sets labels on a cluster.
  10009. func (r *ProjectsZonesClustersService) ResourceLabels(projectId string, zone string, clusterId string, setlabelsrequest *SetLabelsRequest) *ProjectsZonesClustersResourceLabelsCall {
  10010. c := &ProjectsZonesClustersResourceLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10011. c.projectId = projectId
  10012. c.zone = zone
  10013. c.clusterId = clusterId
  10014. c.setlabelsrequest = setlabelsrequest
  10015. return c
  10016. }
  10017. // Fields allows partial responses to be retrieved. See
  10018. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10019. // for more information.
  10020. func (c *ProjectsZonesClustersResourceLabelsCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersResourceLabelsCall {
  10021. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10022. return c
  10023. }
  10024. // Context sets the context to be used in this call's Do method. Any
  10025. // pending HTTP request will be aborted if the provided context is
  10026. // canceled.
  10027. func (c *ProjectsZonesClustersResourceLabelsCall) Context(ctx context.Context) *ProjectsZonesClustersResourceLabelsCall {
  10028. c.ctx_ = ctx
  10029. return c
  10030. }
  10031. // Header returns an http.Header that can be modified by the caller to
  10032. // add HTTP headers to the request.
  10033. func (c *ProjectsZonesClustersResourceLabelsCall) Header() http.Header {
  10034. if c.header_ == nil {
  10035. c.header_ = make(http.Header)
  10036. }
  10037. return c.header_
  10038. }
  10039. func (c *ProjectsZonesClustersResourceLabelsCall) doRequest(alt string) (*http.Response, error) {
  10040. reqHeaders := make(http.Header)
  10041. for k, v := range c.header_ {
  10042. reqHeaders[k] = v
  10043. }
  10044. reqHeaders.Set("User-Agent", c.s.userAgent())
  10045. var body io.Reader = nil
  10046. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlabelsrequest)
  10047. if err != nil {
  10048. return nil, err
  10049. }
  10050. reqHeaders.Set("Content-Type", "application/json")
  10051. c.urlParams_.Set("alt", alt)
  10052. c.urlParams_.Set("prettyPrint", "false")
  10053. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels")
  10054. urls += "?" + c.urlParams_.Encode()
  10055. req, err := http.NewRequest("POST", urls, body)
  10056. if err != nil {
  10057. return nil, err
  10058. }
  10059. req.Header = reqHeaders
  10060. googleapi.Expand(req.URL, map[string]string{
  10061. "projectId": c.projectId,
  10062. "zone": c.zone,
  10063. "clusterId": c.clusterId,
  10064. })
  10065. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10066. }
  10067. // Do executes the "container.projects.zones.clusters.resourceLabels" call.
  10068. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10069. // status code is an error. Response headers are in either
  10070. // *Operation.ServerResponse.Header or (if a response was returned at
  10071. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10072. // to check whether the returned error was because
  10073. // http.StatusNotModified was returned.
  10074. func (c *ProjectsZonesClustersResourceLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10075. gensupport.SetOptions(c.urlParams_, opts...)
  10076. res, err := c.doRequest("json")
  10077. if res != nil && res.StatusCode == http.StatusNotModified {
  10078. if res.Body != nil {
  10079. res.Body.Close()
  10080. }
  10081. return nil, &googleapi.Error{
  10082. Code: res.StatusCode,
  10083. Header: res.Header,
  10084. }
  10085. }
  10086. if err != nil {
  10087. return nil, err
  10088. }
  10089. defer googleapi.CloseBody(res)
  10090. if err := googleapi.CheckResponse(res); err != nil {
  10091. return nil, err
  10092. }
  10093. ret := &Operation{
  10094. ServerResponse: googleapi.ServerResponse{
  10095. Header: res.Header,
  10096. HTTPStatusCode: res.StatusCode,
  10097. },
  10098. }
  10099. target := &ret
  10100. if err := gensupport.DecodeResponse(target, res); err != nil {
  10101. return nil, err
  10102. }
  10103. return ret, nil
  10104. // {
  10105. // "description": "Sets labels on a cluster.",
  10106. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels",
  10107. // "httpMethod": "POST",
  10108. // "id": "container.projects.zones.clusters.resourceLabels",
  10109. // "parameterOrder": [
  10110. // "projectId",
  10111. // "zone",
  10112. // "clusterId"
  10113. // ],
  10114. // "parameters": {
  10115. // "clusterId": {
  10116. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  10117. // "location": "path",
  10118. // "required": true,
  10119. // "type": "string"
  10120. // },
  10121. // "projectId": {
  10122. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  10123. // "location": "path",
  10124. // "required": true,
  10125. // "type": "string"
  10126. // },
  10127. // "zone": {
  10128. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  10129. // "location": "path",
  10130. // "required": true,
  10131. // "type": "string"
  10132. // }
  10133. // },
  10134. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels",
  10135. // "request": {
  10136. // "$ref": "SetLabelsRequest"
  10137. // },
  10138. // "response": {
  10139. // "$ref": "Operation"
  10140. // },
  10141. // "scopes": [
  10142. // "https://www.googleapis.com/auth/cloud-platform"
  10143. // ]
  10144. // }
  10145. }
  10146. // method id "container.projects.zones.clusters.setMaintenancePolicy":
  10147. type ProjectsZonesClustersSetMaintenancePolicyCall struct {
  10148. s *Service
  10149. projectId string
  10150. zone string
  10151. clusterId string
  10152. setmaintenancepolicyrequest *SetMaintenancePolicyRequest
  10153. urlParams_ gensupport.URLParams
  10154. ctx_ context.Context
  10155. header_ http.Header
  10156. }
  10157. // SetMaintenancePolicy: Sets the maintenance policy for a cluster.
  10158. func (r *ProjectsZonesClustersService) SetMaintenancePolicy(projectId string, zone string, clusterId string, setmaintenancepolicyrequest *SetMaintenancePolicyRequest) *ProjectsZonesClustersSetMaintenancePolicyCall {
  10159. c := &ProjectsZonesClustersSetMaintenancePolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10160. c.projectId = projectId
  10161. c.zone = zone
  10162. c.clusterId = clusterId
  10163. c.setmaintenancepolicyrequest = setmaintenancepolicyrequest
  10164. return c
  10165. }
  10166. // Fields allows partial responses to be retrieved. See
  10167. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10168. // for more information.
  10169. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersSetMaintenancePolicyCall {
  10170. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10171. return c
  10172. }
  10173. // Context sets the context to be used in this call's Do method. Any
  10174. // pending HTTP request will be aborted if the provided context is
  10175. // canceled.
  10176. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Context(ctx context.Context) *ProjectsZonesClustersSetMaintenancePolicyCall {
  10177. c.ctx_ = ctx
  10178. return c
  10179. }
  10180. // Header returns an http.Header that can be modified by the caller to
  10181. // add HTTP headers to the request.
  10182. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Header() http.Header {
  10183. if c.header_ == nil {
  10184. c.header_ = make(http.Header)
  10185. }
  10186. return c.header_
  10187. }
  10188. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) doRequest(alt string) (*http.Response, error) {
  10189. reqHeaders := make(http.Header)
  10190. for k, v := range c.header_ {
  10191. reqHeaders[k] = v
  10192. }
  10193. reqHeaders.Set("User-Agent", c.s.userAgent())
  10194. var body io.Reader = nil
  10195. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmaintenancepolicyrequest)
  10196. if err != nil {
  10197. return nil, err
  10198. }
  10199. reqHeaders.Set("Content-Type", "application/json")
  10200. c.urlParams_.Set("alt", alt)
  10201. c.urlParams_.Set("prettyPrint", "false")
  10202. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy")
  10203. urls += "?" + c.urlParams_.Encode()
  10204. req, err := http.NewRequest("POST", urls, body)
  10205. if err != nil {
  10206. return nil, err
  10207. }
  10208. req.Header = reqHeaders
  10209. googleapi.Expand(req.URL, map[string]string{
  10210. "projectId": c.projectId,
  10211. "zone": c.zone,
  10212. "clusterId": c.clusterId,
  10213. })
  10214. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10215. }
  10216. // Do executes the "container.projects.zones.clusters.setMaintenancePolicy" call.
  10217. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10218. // status code is an error. Response headers are in either
  10219. // *Operation.ServerResponse.Header or (if a response was returned at
  10220. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10221. // to check whether the returned error was because
  10222. // http.StatusNotModified was returned.
  10223. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10224. gensupport.SetOptions(c.urlParams_, opts...)
  10225. res, err := c.doRequest("json")
  10226. if res != nil && res.StatusCode == http.StatusNotModified {
  10227. if res.Body != nil {
  10228. res.Body.Close()
  10229. }
  10230. return nil, &googleapi.Error{
  10231. Code: res.StatusCode,
  10232. Header: res.Header,
  10233. }
  10234. }
  10235. if err != nil {
  10236. return nil, err
  10237. }
  10238. defer googleapi.CloseBody(res)
  10239. if err := googleapi.CheckResponse(res); err != nil {
  10240. return nil, err
  10241. }
  10242. ret := &Operation{
  10243. ServerResponse: googleapi.ServerResponse{
  10244. Header: res.Header,
  10245. HTTPStatusCode: res.StatusCode,
  10246. },
  10247. }
  10248. target := &ret
  10249. if err := gensupport.DecodeResponse(target, res); err != nil {
  10250. return nil, err
  10251. }
  10252. return ret, nil
  10253. // {
  10254. // "description": "Sets the maintenance policy for a cluster.",
  10255. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy",
  10256. // "httpMethod": "POST",
  10257. // "id": "container.projects.zones.clusters.setMaintenancePolicy",
  10258. // "parameterOrder": [
  10259. // "projectId",
  10260. // "zone",
  10261. // "clusterId"
  10262. // ],
  10263. // "parameters": {
  10264. // "clusterId": {
  10265. // "description": "The name of the cluster to update.",
  10266. // "location": "path",
  10267. // "required": true,
  10268. // "type": "string"
  10269. // },
  10270. // "projectId": {
  10271. // "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).",
  10272. // "location": "path",
  10273. // "required": true,
  10274. // "type": "string"
  10275. // },
  10276. // "zone": {
  10277. // "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.",
  10278. // "location": "path",
  10279. // "required": true,
  10280. // "type": "string"
  10281. // }
  10282. // },
  10283. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy",
  10284. // "request": {
  10285. // "$ref": "SetMaintenancePolicyRequest"
  10286. // },
  10287. // "response": {
  10288. // "$ref": "Operation"
  10289. // },
  10290. // "scopes": [
  10291. // "https://www.googleapis.com/auth/cloud-platform"
  10292. // ]
  10293. // }
  10294. }
  10295. // method id "container.projects.zones.clusters.setMasterAuth":
  10296. type ProjectsZonesClustersSetMasterAuthCall struct {
  10297. s *Service
  10298. projectId string
  10299. zone string
  10300. clusterId string
  10301. setmasterauthrequest *SetMasterAuthRequest
  10302. urlParams_ gensupport.URLParams
  10303. ctx_ context.Context
  10304. header_ http.Header
  10305. }
  10306. // SetMasterAuth: Sets master auth materials. Currently supports
  10307. // changing the admin password
  10308. // or a specific cluster, either via password generation or explicitly
  10309. // setting
  10310. // the password.
  10311. func (r *ProjectsZonesClustersService) SetMasterAuth(projectId string, zone string, clusterId string, setmasterauthrequest *SetMasterAuthRequest) *ProjectsZonesClustersSetMasterAuthCall {
  10312. c := &ProjectsZonesClustersSetMasterAuthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10313. c.projectId = projectId
  10314. c.zone = zone
  10315. c.clusterId = clusterId
  10316. c.setmasterauthrequest = setmasterauthrequest
  10317. return c
  10318. }
  10319. // Fields allows partial responses to be retrieved. See
  10320. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10321. // for more information.
  10322. func (c *ProjectsZonesClustersSetMasterAuthCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersSetMasterAuthCall {
  10323. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10324. return c
  10325. }
  10326. // Context sets the context to be used in this call's Do method. Any
  10327. // pending HTTP request will be aborted if the provided context is
  10328. // canceled.
  10329. func (c *ProjectsZonesClustersSetMasterAuthCall) Context(ctx context.Context) *ProjectsZonesClustersSetMasterAuthCall {
  10330. c.ctx_ = ctx
  10331. return c
  10332. }
  10333. // Header returns an http.Header that can be modified by the caller to
  10334. // add HTTP headers to the request.
  10335. func (c *ProjectsZonesClustersSetMasterAuthCall) Header() http.Header {
  10336. if c.header_ == nil {
  10337. c.header_ = make(http.Header)
  10338. }
  10339. return c.header_
  10340. }
  10341. func (c *ProjectsZonesClustersSetMasterAuthCall) doRequest(alt string) (*http.Response, error) {
  10342. reqHeaders := make(http.Header)
  10343. for k, v := range c.header_ {
  10344. reqHeaders[k] = v
  10345. }
  10346. reqHeaders.Set("User-Agent", c.s.userAgent())
  10347. var body io.Reader = nil
  10348. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmasterauthrequest)
  10349. if err != nil {
  10350. return nil, err
  10351. }
  10352. reqHeaders.Set("Content-Type", "application/json")
  10353. c.urlParams_.Set("alt", alt)
  10354. c.urlParams_.Set("prettyPrint", "false")
  10355. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth")
  10356. urls += "?" + c.urlParams_.Encode()
  10357. req, err := http.NewRequest("POST", urls, body)
  10358. if err != nil {
  10359. return nil, err
  10360. }
  10361. req.Header = reqHeaders
  10362. googleapi.Expand(req.URL, map[string]string{
  10363. "projectId": c.projectId,
  10364. "zone": c.zone,
  10365. "clusterId": c.clusterId,
  10366. })
  10367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10368. }
  10369. // Do executes the "container.projects.zones.clusters.setMasterAuth" call.
  10370. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10371. // status code is an error. Response headers are in either
  10372. // *Operation.ServerResponse.Header or (if a response was returned at
  10373. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10374. // to check whether the returned error was because
  10375. // http.StatusNotModified was returned.
  10376. func (c *ProjectsZonesClustersSetMasterAuthCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10377. gensupport.SetOptions(c.urlParams_, opts...)
  10378. res, err := c.doRequest("json")
  10379. if res != nil && res.StatusCode == http.StatusNotModified {
  10380. if res.Body != nil {
  10381. res.Body.Close()
  10382. }
  10383. return nil, &googleapi.Error{
  10384. Code: res.StatusCode,
  10385. Header: res.Header,
  10386. }
  10387. }
  10388. if err != nil {
  10389. return nil, err
  10390. }
  10391. defer googleapi.CloseBody(res)
  10392. if err := googleapi.CheckResponse(res); err != nil {
  10393. return nil, err
  10394. }
  10395. ret := &Operation{
  10396. ServerResponse: googleapi.ServerResponse{
  10397. Header: res.Header,
  10398. HTTPStatusCode: res.StatusCode,
  10399. },
  10400. }
  10401. target := &ret
  10402. if err := gensupport.DecodeResponse(target, res); err != nil {
  10403. return nil, err
  10404. }
  10405. return ret, nil
  10406. // {
  10407. // "description": "Sets master auth materials. Currently supports changing the admin password\nor a specific cluster, either via password generation or explicitly setting\nthe password.",
  10408. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth",
  10409. // "httpMethod": "POST",
  10410. // "id": "container.projects.zones.clusters.setMasterAuth",
  10411. // "parameterOrder": [
  10412. // "projectId",
  10413. // "zone",
  10414. // "clusterId"
  10415. // ],
  10416. // "parameters": {
  10417. // "clusterId": {
  10418. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  10419. // "location": "path",
  10420. // "required": true,
  10421. // "type": "string"
  10422. // },
  10423. // "projectId": {
  10424. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  10425. // "location": "path",
  10426. // "required": true,
  10427. // "type": "string"
  10428. // },
  10429. // "zone": {
  10430. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  10431. // "location": "path",
  10432. // "required": true,
  10433. // "type": "string"
  10434. // }
  10435. // },
  10436. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth",
  10437. // "request": {
  10438. // "$ref": "SetMasterAuthRequest"
  10439. // },
  10440. // "response": {
  10441. // "$ref": "Operation"
  10442. // },
  10443. // "scopes": [
  10444. // "https://www.googleapis.com/auth/cloud-platform"
  10445. // ]
  10446. // }
  10447. }
  10448. // method id "container.projects.zones.clusters.setNetworkPolicy":
  10449. type ProjectsZonesClustersSetNetworkPolicyCall struct {
  10450. s *Service
  10451. projectId string
  10452. zone string
  10453. clusterId string
  10454. setnetworkpolicyrequest *SetNetworkPolicyRequest
  10455. urlParams_ gensupport.URLParams
  10456. ctx_ context.Context
  10457. header_ http.Header
  10458. }
  10459. // SetNetworkPolicy: Enables or disables Network Policy for a cluster.
  10460. func (r *ProjectsZonesClustersService) SetNetworkPolicy(projectId string, zone string, clusterId string, setnetworkpolicyrequest *SetNetworkPolicyRequest) *ProjectsZonesClustersSetNetworkPolicyCall {
  10461. c := &ProjectsZonesClustersSetNetworkPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10462. c.projectId = projectId
  10463. c.zone = zone
  10464. c.clusterId = clusterId
  10465. c.setnetworkpolicyrequest = setnetworkpolicyrequest
  10466. return c
  10467. }
  10468. // Fields allows partial responses to be retrieved. See
  10469. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10470. // for more information.
  10471. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersSetNetworkPolicyCall {
  10472. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10473. return c
  10474. }
  10475. // Context sets the context to be used in this call's Do method. Any
  10476. // pending HTTP request will be aborted if the provided context is
  10477. // canceled.
  10478. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Context(ctx context.Context) *ProjectsZonesClustersSetNetworkPolicyCall {
  10479. c.ctx_ = ctx
  10480. return c
  10481. }
  10482. // Header returns an http.Header that can be modified by the caller to
  10483. // add HTTP headers to the request.
  10484. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Header() http.Header {
  10485. if c.header_ == nil {
  10486. c.header_ = make(http.Header)
  10487. }
  10488. return c.header_
  10489. }
  10490. func (c *ProjectsZonesClustersSetNetworkPolicyCall) doRequest(alt string) (*http.Response, error) {
  10491. reqHeaders := make(http.Header)
  10492. for k, v := range c.header_ {
  10493. reqHeaders[k] = v
  10494. }
  10495. reqHeaders.Set("User-Agent", c.s.userAgent())
  10496. var body io.Reader = nil
  10497. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnetworkpolicyrequest)
  10498. if err != nil {
  10499. return nil, err
  10500. }
  10501. reqHeaders.Set("Content-Type", "application/json")
  10502. c.urlParams_.Set("alt", alt)
  10503. c.urlParams_.Set("prettyPrint", "false")
  10504. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy")
  10505. urls += "?" + c.urlParams_.Encode()
  10506. req, err := http.NewRequest("POST", urls, body)
  10507. if err != nil {
  10508. return nil, err
  10509. }
  10510. req.Header = reqHeaders
  10511. googleapi.Expand(req.URL, map[string]string{
  10512. "projectId": c.projectId,
  10513. "zone": c.zone,
  10514. "clusterId": c.clusterId,
  10515. })
  10516. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10517. }
  10518. // Do executes the "container.projects.zones.clusters.setNetworkPolicy" call.
  10519. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10520. // status code is an error. Response headers are in either
  10521. // *Operation.ServerResponse.Header or (if a response was returned at
  10522. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10523. // to check whether the returned error was because
  10524. // http.StatusNotModified was returned.
  10525. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10526. gensupport.SetOptions(c.urlParams_, opts...)
  10527. res, err := c.doRequest("json")
  10528. if res != nil && res.StatusCode == http.StatusNotModified {
  10529. if res.Body != nil {
  10530. res.Body.Close()
  10531. }
  10532. return nil, &googleapi.Error{
  10533. Code: res.StatusCode,
  10534. Header: res.Header,
  10535. }
  10536. }
  10537. if err != nil {
  10538. return nil, err
  10539. }
  10540. defer googleapi.CloseBody(res)
  10541. if err := googleapi.CheckResponse(res); err != nil {
  10542. return nil, err
  10543. }
  10544. ret := &Operation{
  10545. ServerResponse: googleapi.ServerResponse{
  10546. Header: res.Header,
  10547. HTTPStatusCode: res.StatusCode,
  10548. },
  10549. }
  10550. target := &ret
  10551. if err := gensupport.DecodeResponse(target, res); err != nil {
  10552. return nil, err
  10553. }
  10554. return ret, nil
  10555. // {
  10556. // "description": "Enables or disables Network Policy for a cluster.",
  10557. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy",
  10558. // "httpMethod": "POST",
  10559. // "id": "container.projects.zones.clusters.setNetworkPolicy",
  10560. // "parameterOrder": [
  10561. // "projectId",
  10562. // "zone",
  10563. // "clusterId"
  10564. // ],
  10565. // "parameters": {
  10566. // "clusterId": {
  10567. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  10568. // "location": "path",
  10569. // "required": true,
  10570. // "type": "string"
  10571. // },
  10572. // "projectId": {
  10573. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  10574. // "location": "path",
  10575. // "required": true,
  10576. // "type": "string"
  10577. // },
  10578. // "zone": {
  10579. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  10580. // "location": "path",
  10581. // "required": true,
  10582. // "type": "string"
  10583. // }
  10584. // },
  10585. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy",
  10586. // "request": {
  10587. // "$ref": "SetNetworkPolicyRequest"
  10588. // },
  10589. // "response": {
  10590. // "$ref": "Operation"
  10591. // },
  10592. // "scopes": [
  10593. // "https://www.googleapis.com/auth/cloud-platform"
  10594. // ]
  10595. // }
  10596. }
  10597. // method id "container.projects.zones.clusters.startIpRotation":
  10598. type ProjectsZonesClustersStartIpRotationCall struct {
  10599. s *Service
  10600. projectId string
  10601. zone string
  10602. clusterId string
  10603. startiprotationrequest *StartIPRotationRequest
  10604. urlParams_ gensupport.URLParams
  10605. ctx_ context.Context
  10606. header_ http.Header
  10607. }
  10608. // StartIpRotation: Starts master IP rotation.
  10609. func (r *ProjectsZonesClustersService) StartIpRotation(projectId string, zone string, clusterId string, startiprotationrequest *StartIPRotationRequest) *ProjectsZonesClustersStartIpRotationCall {
  10610. c := &ProjectsZonesClustersStartIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10611. c.projectId = projectId
  10612. c.zone = zone
  10613. c.clusterId = clusterId
  10614. c.startiprotationrequest = startiprotationrequest
  10615. return c
  10616. }
  10617. // Fields allows partial responses to be retrieved. See
  10618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10619. // for more information.
  10620. func (c *ProjectsZonesClustersStartIpRotationCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersStartIpRotationCall {
  10621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10622. return c
  10623. }
  10624. // Context sets the context to be used in this call's Do method. Any
  10625. // pending HTTP request will be aborted if the provided context is
  10626. // canceled.
  10627. func (c *ProjectsZonesClustersStartIpRotationCall) Context(ctx context.Context) *ProjectsZonesClustersStartIpRotationCall {
  10628. c.ctx_ = ctx
  10629. return c
  10630. }
  10631. // Header returns an http.Header that can be modified by the caller to
  10632. // add HTTP headers to the request.
  10633. func (c *ProjectsZonesClustersStartIpRotationCall) Header() http.Header {
  10634. if c.header_ == nil {
  10635. c.header_ = make(http.Header)
  10636. }
  10637. return c.header_
  10638. }
  10639. func (c *ProjectsZonesClustersStartIpRotationCall) doRequest(alt string) (*http.Response, error) {
  10640. reqHeaders := make(http.Header)
  10641. for k, v := range c.header_ {
  10642. reqHeaders[k] = v
  10643. }
  10644. reqHeaders.Set("User-Agent", c.s.userAgent())
  10645. var body io.Reader = nil
  10646. body, err := googleapi.WithoutDataWrapper.JSONReader(c.startiprotationrequest)
  10647. if err != nil {
  10648. return nil, err
  10649. }
  10650. reqHeaders.Set("Content-Type", "application/json")
  10651. c.urlParams_.Set("alt", alt)
  10652. c.urlParams_.Set("prettyPrint", "false")
  10653. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation")
  10654. urls += "?" + c.urlParams_.Encode()
  10655. req, err := http.NewRequest("POST", urls, body)
  10656. if err != nil {
  10657. return nil, err
  10658. }
  10659. req.Header = reqHeaders
  10660. googleapi.Expand(req.URL, map[string]string{
  10661. "projectId": c.projectId,
  10662. "zone": c.zone,
  10663. "clusterId": c.clusterId,
  10664. })
  10665. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10666. }
  10667. // Do executes the "container.projects.zones.clusters.startIpRotation" call.
  10668. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10669. // status code is an error. Response headers are in either
  10670. // *Operation.ServerResponse.Header or (if a response was returned at
  10671. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10672. // to check whether the returned error was because
  10673. // http.StatusNotModified was returned.
  10674. func (c *ProjectsZonesClustersStartIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10675. gensupport.SetOptions(c.urlParams_, opts...)
  10676. res, err := c.doRequest("json")
  10677. if res != nil && res.StatusCode == http.StatusNotModified {
  10678. if res.Body != nil {
  10679. res.Body.Close()
  10680. }
  10681. return nil, &googleapi.Error{
  10682. Code: res.StatusCode,
  10683. Header: res.Header,
  10684. }
  10685. }
  10686. if err != nil {
  10687. return nil, err
  10688. }
  10689. defer googleapi.CloseBody(res)
  10690. if err := googleapi.CheckResponse(res); err != nil {
  10691. return nil, err
  10692. }
  10693. ret := &Operation{
  10694. ServerResponse: googleapi.ServerResponse{
  10695. Header: res.Header,
  10696. HTTPStatusCode: res.StatusCode,
  10697. },
  10698. }
  10699. target := &ret
  10700. if err := gensupport.DecodeResponse(target, res); err != nil {
  10701. return nil, err
  10702. }
  10703. return ret, nil
  10704. // {
  10705. // "description": "Starts master IP rotation.",
  10706. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation",
  10707. // "httpMethod": "POST",
  10708. // "id": "container.projects.zones.clusters.startIpRotation",
  10709. // "parameterOrder": [
  10710. // "projectId",
  10711. // "zone",
  10712. // "clusterId"
  10713. // ],
  10714. // "parameters": {
  10715. // "clusterId": {
  10716. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  10717. // "location": "path",
  10718. // "required": true,
  10719. // "type": "string"
  10720. // },
  10721. // "projectId": {
  10722. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  10723. // "location": "path",
  10724. // "required": true,
  10725. // "type": "string"
  10726. // },
  10727. // "zone": {
  10728. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  10729. // "location": "path",
  10730. // "required": true,
  10731. // "type": "string"
  10732. // }
  10733. // },
  10734. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation",
  10735. // "request": {
  10736. // "$ref": "StartIPRotationRequest"
  10737. // },
  10738. // "response": {
  10739. // "$ref": "Operation"
  10740. // },
  10741. // "scopes": [
  10742. // "https://www.googleapis.com/auth/cloud-platform"
  10743. // ]
  10744. // }
  10745. }
  10746. // method id "container.projects.zones.clusters.update":
  10747. type ProjectsZonesClustersUpdateCall struct {
  10748. s *Service
  10749. projectId string
  10750. zone string
  10751. clusterId string
  10752. updateclusterrequest *UpdateClusterRequest
  10753. urlParams_ gensupport.URLParams
  10754. ctx_ context.Context
  10755. header_ http.Header
  10756. }
  10757. // Update: Updates the settings of a specific cluster.
  10758. func (r *ProjectsZonesClustersService) Update(projectId string, zone string, clusterId string, updateclusterrequest *UpdateClusterRequest) *ProjectsZonesClustersUpdateCall {
  10759. c := &ProjectsZonesClustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10760. c.projectId = projectId
  10761. c.zone = zone
  10762. c.clusterId = clusterId
  10763. c.updateclusterrequest = updateclusterrequest
  10764. return c
  10765. }
  10766. // Fields allows partial responses to be retrieved. See
  10767. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10768. // for more information.
  10769. func (c *ProjectsZonesClustersUpdateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersUpdateCall {
  10770. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10771. return c
  10772. }
  10773. // Context sets the context to be used in this call's Do method. Any
  10774. // pending HTTP request will be aborted if the provided context is
  10775. // canceled.
  10776. func (c *ProjectsZonesClustersUpdateCall) Context(ctx context.Context) *ProjectsZonesClustersUpdateCall {
  10777. c.ctx_ = ctx
  10778. return c
  10779. }
  10780. // Header returns an http.Header that can be modified by the caller to
  10781. // add HTTP headers to the request.
  10782. func (c *ProjectsZonesClustersUpdateCall) Header() http.Header {
  10783. if c.header_ == nil {
  10784. c.header_ = make(http.Header)
  10785. }
  10786. return c.header_
  10787. }
  10788. func (c *ProjectsZonesClustersUpdateCall) doRequest(alt string) (*http.Response, error) {
  10789. reqHeaders := make(http.Header)
  10790. for k, v := range c.header_ {
  10791. reqHeaders[k] = v
  10792. }
  10793. reqHeaders.Set("User-Agent", c.s.userAgent())
  10794. var body io.Reader = nil
  10795. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest)
  10796. if err != nil {
  10797. return nil, err
  10798. }
  10799. reqHeaders.Set("Content-Type", "application/json")
  10800. c.urlParams_.Set("alt", alt)
  10801. c.urlParams_.Set("prettyPrint", "false")
  10802. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  10803. urls += "?" + c.urlParams_.Encode()
  10804. req, err := http.NewRequest("PUT", urls, body)
  10805. if err != nil {
  10806. return nil, err
  10807. }
  10808. req.Header = reqHeaders
  10809. googleapi.Expand(req.URL, map[string]string{
  10810. "projectId": c.projectId,
  10811. "zone": c.zone,
  10812. "clusterId": c.clusterId,
  10813. })
  10814. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10815. }
  10816. // Do executes the "container.projects.zones.clusters.update" call.
  10817. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10818. // status code is an error. Response headers are in either
  10819. // *Operation.ServerResponse.Header or (if a response was returned at
  10820. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10821. // to check whether the returned error was because
  10822. // http.StatusNotModified was returned.
  10823. func (c *ProjectsZonesClustersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10824. gensupport.SetOptions(c.urlParams_, opts...)
  10825. res, err := c.doRequest("json")
  10826. if res != nil && res.StatusCode == http.StatusNotModified {
  10827. if res.Body != nil {
  10828. res.Body.Close()
  10829. }
  10830. return nil, &googleapi.Error{
  10831. Code: res.StatusCode,
  10832. Header: res.Header,
  10833. }
  10834. }
  10835. if err != nil {
  10836. return nil, err
  10837. }
  10838. defer googleapi.CloseBody(res)
  10839. if err := googleapi.CheckResponse(res); err != nil {
  10840. return nil, err
  10841. }
  10842. ret := &Operation{
  10843. ServerResponse: googleapi.ServerResponse{
  10844. Header: res.Header,
  10845. HTTPStatusCode: res.StatusCode,
  10846. },
  10847. }
  10848. target := &ret
  10849. if err := gensupport.DecodeResponse(target, res); err != nil {
  10850. return nil, err
  10851. }
  10852. return ret, nil
  10853. // {
  10854. // "description": "Updates the settings of a specific cluster.",
  10855. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  10856. // "httpMethod": "PUT",
  10857. // "id": "container.projects.zones.clusters.update",
  10858. // "parameterOrder": [
  10859. // "projectId",
  10860. // "zone",
  10861. // "clusterId"
  10862. // ],
  10863. // "parameters": {
  10864. // "clusterId": {
  10865. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  10866. // "location": "path",
  10867. // "required": true,
  10868. // "type": "string"
  10869. // },
  10870. // "projectId": {
  10871. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  10872. // "location": "path",
  10873. // "required": true,
  10874. // "type": "string"
  10875. // },
  10876. // "zone": {
  10877. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  10878. // "location": "path",
  10879. // "required": true,
  10880. // "type": "string"
  10881. // }
  10882. // },
  10883. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  10884. // "request": {
  10885. // "$ref": "UpdateClusterRequest"
  10886. // },
  10887. // "response": {
  10888. // "$ref": "Operation"
  10889. // },
  10890. // "scopes": [
  10891. // "https://www.googleapis.com/auth/cloud-platform"
  10892. // ]
  10893. // }
  10894. }
  10895. // method id "container.projects.zones.clusters.nodePools.autoscaling":
  10896. type ProjectsZonesClustersNodePoolsAutoscalingCall struct {
  10897. s *Service
  10898. projectId string
  10899. zone string
  10900. clusterId string
  10901. nodePoolId string
  10902. setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest
  10903. urlParams_ gensupport.URLParams
  10904. ctx_ context.Context
  10905. header_ http.Header
  10906. }
  10907. // Autoscaling: Sets the autoscaling settings for the specified node
  10908. // pool.
  10909. func (r *ProjectsZonesClustersNodePoolsService) Autoscaling(projectId string, zone string, clusterId string, nodePoolId string, setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest) *ProjectsZonesClustersNodePoolsAutoscalingCall {
  10910. c := &ProjectsZonesClustersNodePoolsAutoscalingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10911. c.projectId = projectId
  10912. c.zone = zone
  10913. c.clusterId = clusterId
  10914. c.nodePoolId = nodePoolId
  10915. c.setnodepoolautoscalingrequest = setnodepoolautoscalingrequest
  10916. return c
  10917. }
  10918. // Fields allows partial responses to be retrieved. See
  10919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10920. // for more information.
  10921. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsAutoscalingCall {
  10922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10923. return c
  10924. }
  10925. // Context sets the context to be used in this call's Do method. Any
  10926. // pending HTTP request will be aborted if the provided context is
  10927. // canceled.
  10928. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsAutoscalingCall {
  10929. c.ctx_ = ctx
  10930. return c
  10931. }
  10932. // Header returns an http.Header that can be modified by the caller to
  10933. // add HTTP headers to the request.
  10934. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Header() http.Header {
  10935. if c.header_ == nil {
  10936. c.header_ = make(http.Header)
  10937. }
  10938. return c.header_
  10939. }
  10940. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) doRequest(alt string) (*http.Response, error) {
  10941. reqHeaders := make(http.Header)
  10942. for k, v := range c.header_ {
  10943. reqHeaders[k] = v
  10944. }
  10945. reqHeaders.Set("User-Agent", c.s.userAgent())
  10946. var body io.Reader = nil
  10947. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolautoscalingrequest)
  10948. if err != nil {
  10949. return nil, err
  10950. }
  10951. reqHeaders.Set("Content-Type", "application/json")
  10952. c.urlParams_.Set("alt", alt)
  10953. c.urlParams_.Set("prettyPrint", "false")
  10954. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling")
  10955. urls += "?" + c.urlParams_.Encode()
  10956. req, err := http.NewRequest("POST", urls, body)
  10957. if err != nil {
  10958. return nil, err
  10959. }
  10960. req.Header = reqHeaders
  10961. googleapi.Expand(req.URL, map[string]string{
  10962. "projectId": c.projectId,
  10963. "zone": c.zone,
  10964. "clusterId": c.clusterId,
  10965. "nodePoolId": c.nodePoolId,
  10966. })
  10967. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10968. }
  10969. // Do executes the "container.projects.zones.clusters.nodePools.autoscaling" call.
  10970. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10971. // status code is an error. Response headers are in either
  10972. // *Operation.ServerResponse.Header or (if a response was returned at
  10973. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10974. // to check whether the returned error was because
  10975. // http.StatusNotModified was returned.
  10976. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10977. gensupport.SetOptions(c.urlParams_, opts...)
  10978. res, err := c.doRequest("json")
  10979. if res != nil && res.StatusCode == http.StatusNotModified {
  10980. if res.Body != nil {
  10981. res.Body.Close()
  10982. }
  10983. return nil, &googleapi.Error{
  10984. Code: res.StatusCode,
  10985. Header: res.Header,
  10986. }
  10987. }
  10988. if err != nil {
  10989. return nil, err
  10990. }
  10991. defer googleapi.CloseBody(res)
  10992. if err := googleapi.CheckResponse(res); err != nil {
  10993. return nil, err
  10994. }
  10995. ret := &Operation{
  10996. ServerResponse: googleapi.ServerResponse{
  10997. Header: res.Header,
  10998. HTTPStatusCode: res.StatusCode,
  10999. },
  11000. }
  11001. target := &ret
  11002. if err := gensupport.DecodeResponse(target, res); err != nil {
  11003. return nil, err
  11004. }
  11005. return ret, nil
  11006. // {
  11007. // "description": "Sets the autoscaling settings for the specified node pool.",
  11008. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling",
  11009. // "httpMethod": "POST",
  11010. // "id": "container.projects.zones.clusters.nodePools.autoscaling",
  11011. // "parameterOrder": [
  11012. // "projectId",
  11013. // "zone",
  11014. // "clusterId",
  11015. // "nodePoolId"
  11016. // ],
  11017. // "parameters": {
  11018. // "clusterId": {
  11019. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  11020. // "location": "path",
  11021. // "required": true,
  11022. // "type": "string"
  11023. // },
  11024. // "nodePoolId": {
  11025. // "description": "Deprecated. The name of the node pool to upgrade.\nThis field has been deprecated and replaced by the name field.",
  11026. // "location": "path",
  11027. // "required": true,
  11028. // "type": "string"
  11029. // },
  11030. // "projectId": {
  11031. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  11032. // "location": "path",
  11033. // "required": true,
  11034. // "type": "string"
  11035. // },
  11036. // "zone": {
  11037. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  11038. // "location": "path",
  11039. // "required": true,
  11040. // "type": "string"
  11041. // }
  11042. // },
  11043. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling",
  11044. // "request": {
  11045. // "$ref": "SetNodePoolAutoscalingRequest"
  11046. // },
  11047. // "response": {
  11048. // "$ref": "Operation"
  11049. // },
  11050. // "scopes": [
  11051. // "https://www.googleapis.com/auth/cloud-platform"
  11052. // ]
  11053. // }
  11054. }
  11055. // method id "container.projects.zones.clusters.nodePools.create":
  11056. type ProjectsZonesClustersNodePoolsCreateCall struct {
  11057. s *Service
  11058. projectId string
  11059. zone string
  11060. clusterId string
  11061. createnodepoolrequest *CreateNodePoolRequest
  11062. urlParams_ gensupport.URLParams
  11063. ctx_ context.Context
  11064. header_ http.Header
  11065. }
  11066. // Create: Creates a node pool for a cluster.
  11067. func (r *ProjectsZonesClustersNodePoolsService) Create(projectId string, zone string, clusterId string, createnodepoolrequest *CreateNodePoolRequest) *ProjectsZonesClustersNodePoolsCreateCall {
  11068. c := &ProjectsZonesClustersNodePoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11069. c.projectId = projectId
  11070. c.zone = zone
  11071. c.clusterId = clusterId
  11072. c.createnodepoolrequest = createnodepoolrequest
  11073. return c
  11074. }
  11075. // Fields allows partial responses to be retrieved. See
  11076. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11077. // for more information.
  11078. func (c *ProjectsZonesClustersNodePoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsCreateCall {
  11079. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11080. return c
  11081. }
  11082. // Context sets the context to be used in this call's Do method. Any
  11083. // pending HTTP request will be aborted if the provided context is
  11084. // canceled.
  11085. func (c *ProjectsZonesClustersNodePoolsCreateCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsCreateCall {
  11086. c.ctx_ = ctx
  11087. return c
  11088. }
  11089. // Header returns an http.Header that can be modified by the caller to
  11090. // add HTTP headers to the request.
  11091. func (c *ProjectsZonesClustersNodePoolsCreateCall) Header() http.Header {
  11092. if c.header_ == nil {
  11093. c.header_ = make(http.Header)
  11094. }
  11095. return c.header_
  11096. }
  11097. func (c *ProjectsZonesClustersNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) {
  11098. reqHeaders := make(http.Header)
  11099. for k, v := range c.header_ {
  11100. reqHeaders[k] = v
  11101. }
  11102. reqHeaders.Set("User-Agent", c.s.userAgent())
  11103. var body io.Reader = nil
  11104. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createnodepoolrequest)
  11105. if err != nil {
  11106. return nil, err
  11107. }
  11108. reqHeaders.Set("Content-Type", "application/json")
  11109. c.urlParams_.Set("alt", alt)
  11110. c.urlParams_.Set("prettyPrint", "false")
  11111. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools")
  11112. urls += "?" + c.urlParams_.Encode()
  11113. req, err := http.NewRequest("POST", urls, body)
  11114. if err != nil {
  11115. return nil, err
  11116. }
  11117. req.Header = reqHeaders
  11118. googleapi.Expand(req.URL, map[string]string{
  11119. "projectId": c.projectId,
  11120. "zone": c.zone,
  11121. "clusterId": c.clusterId,
  11122. })
  11123. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11124. }
  11125. // Do executes the "container.projects.zones.clusters.nodePools.create" call.
  11126. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11127. // status code is an error. Response headers are in either
  11128. // *Operation.ServerResponse.Header or (if a response was returned at
  11129. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11130. // to check whether the returned error was because
  11131. // http.StatusNotModified was returned.
  11132. func (c *ProjectsZonesClustersNodePoolsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11133. gensupport.SetOptions(c.urlParams_, opts...)
  11134. res, err := c.doRequest("json")
  11135. if res != nil && res.StatusCode == http.StatusNotModified {
  11136. if res.Body != nil {
  11137. res.Body.Close()
  11138. }
  11139. return nil, &googleapi.Error{
  11140. Code: res.StatusCode,
  11141. Header: res.Header,
  11142. }
  11143. }
  11144. if err != nil {
  11145. return nil, err
  11146. }
  11147. defer googleapi.CloseBody(res)
  11148. if err := googleapi.CheckResponse(res); err != nil {
  11149. return nil, err
  11150. }
  11151. ret := &Operation{
  11152. ServerResponse: googleapi.ServerResponse{
  11153. Header: res.Header,
  11154. HTTPStatusCode: res.StatusCode,
  11155. },
  11156. }
  11157. target := &ret
  11158. if err := gensupport.DecodeResponse(target, res); err != nil {
  11159. return nil, err
  11160. }
  11161. return ret, nil
  11162. // {
  11163. // "description": "Creates a node pool for a cluster.",
  11164. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  11165. // "httpMethod": "POST",
  11166. // "id": "container.projects.zones.clusters.nodePools.create",
  11167. // "parameterOrder": [
  11168. // "projectId",
  11169. // "zone",
  11170. // "clusterId"
  11171. // ],
  11172. // "parameters": {
  11173. // "clusterId": {
  11174. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the parent field.",
  11175. // "location": "path",
  11176. // "required": true,
  11177. // "type": "string"
  11178. // },
  11179. // "projectId": {
  11180. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the parent field.",
  11181. // "location": "path",
  11182. // "required": true,
  11183. // "type": "string"
  11184. // },
  11185. // "zone": {
  11186. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the parent field.",
  11187. // "location": "path",
  11188. // "required": true,
  11189. // "type": "string"
  11190. // }
  11191. // },
  11192. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  11193. // "request": {
  11194. // "$ref": "CreateNodePoolRequest"
  11195. // },
  11196. // "response": {
  11197. // "$ref": "Operation"
  11198. // },
  11199. // "scopes": [
  11200. // "https://www.googleapis.com/auth/cloud-platform"
  11201. // ]
  11202. // }
  11203. }
  11204. // method id "container.projects.zones.clusters.nodePools.delete":
  11205. type ProjectsZonesClustersNodePoolsDeleteCall struct {
  11206. s *Service
  11207. projectId string
  11208. zone string
  11209. clusterId string
  11210. nodePoolId string
  11211. urlParams_ gensupport.URLParams
  11212. ctx_ context.Context
  11213. header_ http.Header
  11214. }
  11215. // Delete: Deletes a node pool from a cluster.
  11216. func (r *ProjectsZonesClustersNodePoolsService) Delete(projectId string, zone string, clusterId string, nodePoolId string) *ProjectsZonesClustersNodePoolsDeleteCall {
  11217. c := &ProjectsZonesClustersNodePoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11218. c.projectId = projectId
  11219. c.zone = zone
  11220. c.clusterId = clusterId
  11221. c.nodePoolId = nodePoolId
  11222. return c
  11223. }
  11224. // Name sets the optional parameter "name": The name (project, location,
  11225. // cluster, node pool id) of the node pool to
  11226. // delete. Specified in the
  11227. // format
  11228. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  11229. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Name(name string) *ProjectsZonesClustersNodePoolsDeleteCall {
  11230. c.urlParams_.Set("name", name)
  11231. return c
  11232. }
  11233. // Fields allows partial responses to be retrieved. See
  11234. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11235. // for more information.
  11236. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsDeleteCall {
  11237. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  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 *ProjectsZonesClustersNodePoolsDeleteCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsDeleteCall {
  11244. c.ctx_ = ctx
  11245. return c
  11246. }
  11247. // Header returns an http.Header that can be modified by the caller to
  11248. // add HTTP headers to the request.
  11249. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Header() http.Header {
  11250. if c.header_ == nil {
  11251. c.header_ = make(http.Header)
  11252. }
  11253. return c.header_
  11254. }
  11255. func (c *ProjectsZonesClustersNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  11256. reqHeaders := make(http.Header)
  11257. for k, v := range c.header_ {
  11258. reqHeaders[k] = v
  11259. }
  11260. reqHeaders.Set("User-Agent", c.s.userAgent())
  11261. var body io.Reader = nil
  11262. c.urlParams_.Set("alt", alt)
  11263. c.urlParams_.Set("prettyPrint", "false")
  11264. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}")
  11265. urls += "?" + c.urlParams_.Encode()
  11266. req, err := http.NewRequest("DELETE", urls, body)
  11267. if err != nil {
  11268. return nil, err
  11269. }
  11270. req.Header = reqHeaders
  11271. googleapi.Expand(req.URL, map[string]string{
  11272. "projectId": c.projectId,
  11273. "zone": c.zone,
  11274. "clusterId": c.clusterId,
  11275. "nodePoolId": c.nodePoolId,
  11276. })
  11277. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11278. }
  11279. // Do executes the "container.projects.zones.clusters.nodePools.delete" call.
  11280. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11281. // status code is an error. Response headers are in either
  11282. // *Operation.ServerResponse.Header or (if a response was returned at
  11283. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11284. // to check whether the returned error was because
  11285. // http.StatusNotModified was returned.
  11286. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11287. gensupport.SetOptions(c.urlParams_, opts...)
  11288. res, err := c.doRequest("json")
  11289. if res != nil && res.StatusCode == http.StatusNotModified {
  11290. if res.Body != nil {
  11291. res.Body.Close()
  11292. }
  11293. return nil, &googleapi.Error{
  11294. Code: res.StatusCode,
  11295. Header: res.Header,
  11296. }
  11297. }
  11298. if err != nil {
  11299. return nil, err
  11300. }
  11301. defer googleapi.CloseBody(res)
  11302. if err := googleapi.CheckResponse(res); err != nil {
  11303. return nil, err
  11304. }
  11305. ret := &Operation{
  11306. ServerResponse: googleapi.ServerResponse{
  11307. Header: res.Header,
  11308. HTTPStatusCode: res.StatusCode,
  11309. },
  11310. }
  11311. target := &ret
  11312. if err := gensupport.DecodeResponse(target, res); err != nil {
  11313. return nil, err
  11314. }
  11315. return ret, nil
  11316. // {
  11317. // "description": "Deletes a node pool from a cluster.",
  11318. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  11319. // "httpMethod": "DELETE",
  11320. // "id": "container.projects.zones.clusters.nodePools.delete",
  11321. // "parameterOrder": [
  11322. // "projectId",
  11323. // "zone",
  11324. // "clusterId",
  11325. // "nodePoolId"
  11326. // ],
  11327. // "parameters": {
  11328. // "clusterId": {
  11329. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  11330. // "location": "path",
  11331. // "required": true,
  11332. // "type": "string"
  11333. // },
  11334. // "name": {
  11335. // "description": "The name (project, location, cluster, node pool id) of the node pool to\ndelete. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  11336. // "location": "query",
  11337. // "type": "string"
  11338. // },
  11339. // "nodePoolId": {
  11340. // "description": "Deprecated. The name of the node pool to delete.\nThis field has been deprecated and replaced by the name field.",
  11341. // "location": "path",
  11342. // "required": true,
  11343. // "type": "string"
  11344. // },
  11345. // "projectId": {
  11346. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  11347. // "location": "path",
  11348. // "required": true,
  11349. // "type": "string"
  11350. // },
  11351. // "zone": {
  11352. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  11353. // "location": "path",
  11354. // "required": true,
  11355. // "type": "string"
  11356. // }
  11357. // },
  11358. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  11359. // "response": {
  11360. // "$ref": "Operation"
  11361. // },
  11362. // "scopes": [
  11363. // "https://www.googleapis.com/auth/cloud-platform"
  11364. // ]
  11365. // }
  11366. }
  11367. // method id "container.projects.zones.clusters.nodePools.get":
  11368. type ProjectsZonesClustersNodePoolsGetCall struct {
  11369. s *Service
  11370. projectId string
  11371. zone string
  11372. clusterId string
  11373. nodePoolId string
  11374. urlParams_ gensupport.URLParams
  11375. ifNoneMatch_ string
  11376. ctx_ context.Context
  11377. header_ http.Header
  11378. }
  11379. // Get: Retrieves the requested node pool.
  11380. func (r *ProjectsZonesClustersNodePoolsService) Get(projectId string, zone string, clusterId string, nodePoolId string) *ProjectsZonesClustersNodePoolsGetCall {
  11381. c := &ProjectsZonesClustersNodePoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11382. c.projectId = projectId
  11383. c.zone = zone
  11384. c.clusterId = clusterId
  11385. c.nodePoolId = nodePoolId
  11386. return c
  11387. }
  11388. // Name sets the optional parameter "name": The name (project, location,
  11389. // cluster, node pool id) of the node pool to
  11390. // get. Specified in the
  11391. // format
  11392. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  11393. func (c *ProjectsZonesClustersNodePoolsGetCall) Name(name string) *ProjectsZonesClustersNodePoolsGetCall {
  11394. c.urlParams_.Set("name", name)
  11395. return c
  11396. }
  11397. // Fields allows partial responses to be retrieved. See
  11398. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11399. // for more information.
  11400. func (c *ProjectsZonesClustersNodePoolsGetCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsGetCall {
  11401. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11402. return c
  11403. }
  11404. // IfNoneMatch sets the optional parameter which makes the operation
  11405. // fail if the object's ETag matches the given value. This is useful for
  11406. // getting updates only after the object has changed since the last
  11407. // request. Use googleapi.IsNotModified to check whether the response
  11408. // error from Do is the result of In-None-Match.
  11409. func (c *ProjectsZonesClustersNodePoolsGetCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersNodePoolsGetCall {
  11410. c.ifNoneMatch_ = entityTag
  11411. return c
  11412. }
  11413. // Context sets the context to be used in this call's Do method. Any
  11414. // pending HTTP request will be aborted if the provided context is
  11415. // canceled.
  11416. func (c *ProjectsZonesClustersNodePoolsGetCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsGetCall {
  11417. c.ctx_ = ctx
  11418. return c
  11419. }
  11420. // Header returns an http.Header that can be modified by the caller to
  11421. // add HTTP headers to the request.
  11422. func (c *ProjectsZonesClustersNodePoolsGetCall) Header() http.Header {
  11423. if c.header_ == nil {
  11424. c.header_ = make(http.Header)
  11425. }
  11426. return c.header_
  11427. }
  11428. func (c *ProjectsZonesClustersNodePoolsGetCall) doRequest(alt string) (*http.Response, error) {
  11429. reqHeaders := make(http.Header)
  11430. for k, v := range c.header_ {
  11431. reqHeaders[k] = v
  11432. }
  11433. reqHeaders.Set("User-Agent", c.s.userAgent())
  11434. if c.ifNoneMatch_ != "" {
  11435. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11436. }
  11437. var body io.Reader = nil
  11438. c.urlParams_.Set("alt", alt)
  11439. c.urlParams_.Set("prettyPrint", "false")
  11440. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}")
  11441. urls += "?" + c.urlParams_.Encode()
  11442. req, err := http.NewRequest("GET", urls, body)
  11443. if err != nil {
  11444. return nil, err
  11445. }
  11446. req.Header = reqHeaders
  11447. googleapi.Expand(req.URL, map[string]string{
  11448. "projectId": c.projectId,
  11449. "zone": c.zone,
  11450. "clusterId": c.clusterId,
  11451. "nodePoolId": c.nodePoolId,
  11452. })
  11453. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11454. }
  11455. // Do executes the "container.projects.zones.clusters.nodePools.get" call.
  11456. // Exactly one of *NodePool or error will be non-nil. Any non-2xx status
  11457. // code is an error. Response headers are in either
  11458. // *NodePool.ServerResponse.Header or (if a response was returned at
  11459. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11460. // to check whether the returned error was because
  11461. // http.StatusNotModified was returned.
  11462. func (c *ProjectsZonesClustersNodePoolsGetCall) Do(opts ...googleapi.CallOption) (*NodePool, error) {
  11463. gensupport.SetOptions(c.urlParams_, opts...)
  11464. res, err := c.doRequest("json")
  11465. if res != nil && res.StatusCode == http.StatusNotModified {
  11466. if res.Body != nil {
  11467. res.Body.Close()
  11468. }
  11469. return nil, &googleapi.Error{
  11470. Code: res.StatusCode,
  11471. Header: res.Header,
  11472. }
  11473. }
  11474. if err != nil {
  11475. return nil, err
  11476. }
  11477. defer googleapi.CloseBody(res)
  11478. if err := googleapi.CheckResponse(res); err != nil {
  11479. return nil, err
  11480. }
  11481. ret := &NodePool{
  11482. ServerResponse: googleapi.ServerResponse{
  11483. Header: res.Header,
  11484. HTTPStatusCode: res.StatusCode,
  11485. },
  11486. }
  11487. target := &ret
  11488. if err := gensupport.DecodeResponse(target, res); err != nil {
  11489. return nil, err
  11490. }
  11491. return ret, nil
  11492. // {
  11493. // "description": "Retrieves the requested node pool.",
  11494. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  11495. // "httpMethod": "GET",
  11496. // "id": "container.projects.zones.clusters.nodePools.get",
  11497. // "parameterOrder": [
  11498. // "projectId",
  11499. // "zone",
  11500. // "clusterId",
  11501. // "nodePoolId"
  11502. // ],
  11503. // "parameters": {
  11504. // "clusterId": {
  11505. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  11506. // "location": "path",
  11507. // "required": true,
  11508. // "type": "string"
  11509. // },
  11510. // "name": {
  11511. // "description": "The name (project, location, cluster, node pool id) of the node pool to\nget. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  11512. // "location": "query",
  11513. // "type": "string"
  11514. // },
  11515. // "nodePoolId": {
  11516. // "description": "Deprecated. The name of the node pool.\nThis field has been deprecated and replaced by the name field.",
  11517. // "location": "path",
  11518. // "required": true,
  11519. // "type": "string"
  11520. // },
  11521. // "projectId": {
  11522. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  11523. // "location": "path",
  11524. // "required": true,
  11525. // "type": "string"
  11526. // },
  11527. // "zone": {
  11528. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  11529. // "location": "path",
  11530. // "required": true,
  11531. // "type": "string"
  11532. // }
  11533. // },
  11534. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  11535. // "response": {
  11536. // "$ref": "NodePool"
  11537. // },
  11538. // "scopes": [
  11539. // "https://www.googleapis.com/auth/cloud-platform"
  11540. // ]
  11541. // }
  11542. }
  11543. // method id "container.projects.zones.clusters.nodePools.list":
  11544. type ProjectsZonesClustersNodePoolsListCall struct {
  11545. s *Service
  11546. projectId string
  11547. zone string
  11548. clusterId string
  11549. urlParams_ gensupport.URLParams
  11550. ifNoneMatch_ string
  11551. ctx_ context.Context
  11552. header_ http.Header
  11553. }
  11554. // List: Lists the node pools for a cluster.
  11555. func (r *ProjectsZonesClustersNodePoolsService) List(projectId string, zone string, clusterId string) *ProjectsZonesClustersNodePoolsListCall {
  11556. c := &ProjectsZonesClustersNodePoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11557. c.projectId = projectId
  11558. c.zone = zone
  11559. c.clusterId = clusterId
  11560. return c
  11561. }
  11562. // Parent sets the optional parameter "parent": The parent (project,
  11563. // location, cluster id) where the node pools will be
  11564. // listed. Specified in the format 'projects/*/locations/*/clusters/*'.
  11565. func (c *ProjectsZonesClustersNodePoolsListCall) Parent(parent string) *ProjectsZonesClustersNodePoolsListCall {
  11566. c.urlParams_.Set("parent", parent)
  11567. return c
  11568. }
  11569. // Fields allows partial responses to be retrieved. See
  11570. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11571. // for more information.
  11572. func (c *ProjectsZonesClustersNodePoolsListCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsListCall {
  11573. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11574. return c
  11575. }
  11576. // IfNoneMatch sets the optional parameter which makes the operation
  11577. // fail if the object's ETag matches the given value. This is useful for
  11578. // getting updates only after the object has changed since the last
  11579. // request. Use googleapi.IsNotModified to check whether the response
  11580. // error from Do is the result of In-None-Match.
  11581. func (c *ProjectsZonesClustersNodePoolsListCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersNodePoolsListCall {
  11582. c.ifNoneMatch_ = entityTag
  11583. return c
  11584. }
  11585. // Context sets the context to be used in this call's Do method. Any
  11586. // pending HTTP request will be aborted if the provided context is
  11587. // canceled.
  11588. func (c *ProjectsZonesClustersNodePoolsListCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsListCall {
  11589. c.ctx_ = ctx
  11590. return c
  11591. }
  11592. // Header returns an http.Header that can be modified by the caller to
  11593. // add HTTP headers to the request.
  11594. func (c *ProjectsZonesClustersNodePoolsListCall) Header() http.Header {
  11595. if c.header_ == nil {
  11596. c.header_ = make(http.Header)
  11597. }
  11598. return c.header_
  11599. }
  11600. func (c *ProjectsZonesClustersNodePoolsListCall) doRequest(alt string) (*http.Response, error) {
  11601. reqHeaders := make(http.Header)
  11602. for k, v := range c.header_ {
  11603. reqHeaders[k] = v
  11604. }
  11605. reqHeaders.Set("User-Agent", c.s.userAgent())
  11606. if c.ifNoneMatch_ != "" {
  11607. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11608. }
  11609. var body io.Reader = nil
  11610. c.urlParams_.Set("alt", alt)
  11611. c.urlParams_.Set("prettyPrint", "false")
  11612. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools")
  11613. urls += "?" + c.urlParams_.Encode()
  11614. req, err := http.NewRequest("GET", urls, body)
  11615. if err != nil {
  11616. return nil, err
  11617. }
  11618. req.Header = reqHeaders
  11619. googleapi.Expand(req.URL, map[string]string{
  11620. "projectId": c.projectId,
  11621. "zone": c.zone,
  11622. "clusterId": c.clusterId,
  11623. })
  11624. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11625. }
  11626. // Do executes the "container.projects.zones.clusters.nodePools.list" call.
  11627. // Exactly one of *ListNodePoolsResponse or error will be non-nil. Any
  11628. // non-2xx status code is an error. Response headers are in either
  11629. // *ListNodePoolsResponse.ServerResponse.Header or (if a response was
  11630. // returned at all) in error.(*googleapi.Error).Header. Use
  11631. // googleapi.IsNotModified to check whether the returned error was
  11632. // because http.StatusNotModified was returned.
  11633. func (c *ProjectsZonesClustersNodePoolsListCall) Do(opts ...googleapi.CallOption) (*ListNodePoolsResponse, error) {
  11634. gensupport.SetOptions(c.urlParams_, opts...)
  11635. res, err := c.doRequest("json")
  11636. if res != nil && res.StatusCode == http.StatusNotModified {
  11637. if res.Body != nil {
  11638. res.Body.Close()
  11639. }
  11640. return nil, &googleapi.Error{
  11641. Code: res.StatusCode,
  11642. Header: res.Header,
  11643. }
  11644. }
  11645. if err != nil {
  11646. return nil, err
  11647. }
  11648. defer googleapi.CloseBody(res)
  11649. if err := googleapi.CheckResponse(res); err != nil {
  11650. return nil, err
  11651. }
  11652. ret := &ListNodePoolsResponse{
  11653. ServerResponse: googleapi.ServerResponse{
  11654. Header: res.Header,
  11655. HTTPStatusCode: res.StatusCode,
  11656. },
  11657. }
  11658. target := &ret
  11659. if err := gensupport.DecodeResponse(target, res); err != nil {
  11660. return nil, err
  11661. }
  11662. return ret, nil
  11663. // {
  11664. // "description": "Lists the node pools for a cluster.",
  11665. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  11666. // "httpMethod": "GET",
  11667. // "id": "container.projects.zones.clusters.nodePools.list",
  11668. // "parameterOrder": [
  11669. // "projectId",
  11670. // "zone",
  11671. // "clusterId"
  11672. // ],
  11673. // "parameters": {
  11674. // "clusterId": {
  11675. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the parent field.",
  11676. // "location": "path",
  11677. // "required": true,
  11678. // "type": "string"
  11679. // },
  11680. // "parent": {
  11681. // "description": "The parent (project, location, cluster id) where the node pools will be\nlisted. Specified in the format 'projects/*/locations/*/clusters/*'.",
  11682. // "location": "query",
  11683. // "type": "string"
  11684. // },
  11685. // "projectId": {
  11686. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the parent field.",
  11687. // "location": "path",
  11688. // "required": true,
  11689. // "type": "string"
  11690. // },
  11691. // "zone": {
  11692. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the parent field.",
  11693. // "location": "path",
  11694. // "required": true,
  11695. // "type": "string"
  11696. // }
  11697. // },
  11698. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  11699. // "response": {
  11700. // "$ref": "ListNodePoolsResponse"
  11701. // },
  11702. // "scopes": [
  11703. // "https://www.googleapis.com/auth/cloud-platform"
  11704. // ]
  11705. // }
  11706. }
  11707. // method id "container.projects.zones.clusters.nodePools.rollback":
  11708. type ProjectsZonesClustersNodePoolsRollbackCall struct {
  11709. s *Service
  11710. projectId string
  11711. zone string
  11712. clusterId string
  11713. nodePoolId string
  11714. rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest
  11715. urlParams_ gensupport.URLParams
  11716. ctx_ context.Context
  11717. header_ http.Header
  11718. }
  11719. // Rollback: Rolls back a previously Aborted or Failed NodePool
  11720. // upgrade.
  11721. // This makes no changes if the last upgrade successfully completed.
  11722. func (r *ProjectsZonesClustersNodePoolsService) Rollback(projectId string, zone string, clusterId string, nodePoolId string, rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest) *ProjectsZonesClustersNodePoolsRollbackCall {
  11723. c := &ProjectsZonesClustersNodePoolsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11724. c.projectId = projectId
  11725. c.zone = zone
  11726. c.clusterId = clusterId
  11727. c.nodePoolId = nodePoolId
  11728. c.rollbacknodepoolupgraderequest = rollbacknodepoolupgraderequest
  11729. return c
  11730. }
  11731. // Fields allows partial responses to be retrieved. See
  11732. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11733. // for more information.
  11734. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsRollbackCall {
  11735. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11736. return c
  11737. }
  11738. // Context sets the context to be used in this call's Do method. Any
  11739. // pending HTTP request will be aborted if the provided context is
  11740. // canceled.
  11741. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsRollbackCall {
  11742. c.ctx_ = ctx
  11743. return c
  11744. }
  11745. // Header returns an http.Header that can be modified by the caller to
  11746. // add HTTP headers to the request.
  11747. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Header() http.Header {
  11748. if c.header_ == nil {
  11749. c.header_ = make(http.Header)
  11750. }
  11751. return c.header_
  11752. }
  11753. func (c *ProjectsZonesClustersNodePoolsRollbackCall) doRequest(alt string) (*http.Response, error) {
  11754. reqHeaders := make(http.Header)
  11755. for k, v := range c.header_ {
  11756. reqHeaders[k] = v
  11757. }
  11758. reqHeaders.Set("User-Agent", c.s.userAgent())
  11759. var body io.Reader = nil
  11760. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbacknodepoolupgraderequest)
  11761. if err != nil {
  11762. return nil, err
  11763. }
  11764. reqHeaders.Set("Content-Type", "application/json")
  11765. c.urlParams_.Set("alt", alt)
  11766. c.urlParams_.Set("prettyPrint", "false")
  11767. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback")
  11768. urls += "?" + c.urlParams_.Encode()
  11769. req, err := http.NewRequest("POST", urls, body)
  11770. if err != nil {
  11771. return nil, err
  11772. }
  11773. req.Header = reqHeaders
  11774. googleapi.Expand(req.URL, map[string]string{
  11775. "projectId": c.projectId,
  11776. "zone": c.zone,
  11777. "clusterId": c.clusterId,
  11778. "nodePoolId": c.nodePoolId,
  11779. })
  11780. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11781. }
  11782. // Do executes the "container.projects.zones.clusters.nodePools.rollback" call.
  11783. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11784. // status code is an error. Response headers are in either
  11785. // *Operation.ServerResponse.Header or (if a response was returned at
  11786. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11787. // to check whether the returned error was because
  11788. // http.StatusNotModified was returned.
  11789. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11790. gensupport.SetOptions(c.urlParams_, opts...)
  11791. res, err := c.doRequest("json")
  11792. if res != nil && res.StatusCode == http.StatusNotModified {
  11793. if res.Body != nil {
  11794. res.Body.Close()
  11795. }
  11796. return nil, &googleapi.Error{
  11797. Code: res.StatusCode,
  11798. Header: res.Header,
  11799. }
  11800. }
  11801. if err != nil {
  11802. return nil, err
  11803. }
  11804. defer googleapi.CloseBody(res)
  11805. if err := googleapi.CheckResponse(res); err != nil {
  11806. return nil, err
  11807. }
  11808. ret := &Operation{
  11809. ServerResponse: googleapi.ServerResponse{
  11810. Header: res.Header,
  11811. HTTPStatusCode: res.StatusCode,
  11812. },
  11813. }
  11814. target := &ret
  11815. if err := gensupport.DecodeResponse(target, res); err != nil {
  11816. return nil, err
  11817. }
  11818. return ret, nil
  11819. // {
  11820. // "description": "Rolls back a previously Aborted or Failed NodePool upgrade.\nThis makes no changes if the last upgrade successfully completed.",
  11821. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback",
  11822. // "httpMethod": "POST",
  11823. // "id": "container.projects.zones.clusters.nodePools.rollback",
  11824. // "parameterOrder": [
  11825. // "projectId",
  11826. // "zone",
  11827. // "clusterId",
  11828. // "nodePoolId"
  11829. // ],
  11830. // "parameters": {
  11831. // "clusterId": {
  11832. // "description": "Deprecated. The name of the cluster to rollback.\nThis field has been deprecated and replaced by the name field.",
  11833. // "location": "path",
  11834. // "required": true,
  11835. // "type": "string"
  11836. // },
  11837. // "nodePoolId": {
  11838. // "description": "Deprecated. The name of the node pool to rollback.\nThis field has been deprecated and replaced by the name field.",
  11839. // "location": "path",
  11840. // "required": true,
  11841. // "type": "string"
  11842. // },
  11843. // "projectId": {
  11844. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  11845. // "location": "path",
  11846. // "required": true,
  11847. // "type": "string"
  11848. // },
  11849. // "zone": {
  11850. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  11851. // "location": "path",
  11852. // "required": true,
  11853. // "type": "string"
  11854. // }
  11855. // },
  11856. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback",
  11857. // "request": {
  11858. // "$ref": "RollbackNodePoolUpgradeRequest"
  11859. // },
  11860. // "response": {
  11861. // "$ref": "Operation"
  11862. // },
  11863. // "scopes": [
  11864. // "https://www.googleapis.com/auth/cloud-platform"
  11865. // ]
  11866. // }
  11867. }
  11868. // method id "container.projects.zones.clusters.nodePools.setManagement":
  11869. type ProjectsZonesClustersNodePoolsSetManagementCall struct {
  11870. s *Service
  11871. projectId string
  11872. zone string
  11873. clusterId string
  11874. nodePoolId string
  11875. setnodepoolmanagementrequest *SetNodePoolManagementRequest
  11876. urlParams_ gensupport.URLParams
  11877. ctx_ context.Context
  11878. header_ http.Header
  11879. }
  11880. // SetManagement: Sets the NodeManagement options for a node pool.
  11881. func (r *ProjectsZonesClustersNodePoolsService) SetManagement(projectId string, zone string, clusterId string, nodePoolId string, setnodepoolmanagementrequest *SetNodePoolManagementRequest) *ProjectsZonesClustersNodePoolsSetManagementCall {
  11882. c := &ProjectsZonesClustersNodePoolsSetManagementCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11883. c.projectId = projectId
  11884. c.zone = zone
  11885. c.clusterId = clusterId
  11886. c.nodePoolId = nodePoolId
  11887. c.setnodepoolmanagementrequest = setnodepoolmanagementrequest
  11888. return c
  11889. }
  11890. // Fields allows partial responses to be retrieved. See
  11891. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11892. // for more information.
  11893. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsSetManagementCall {
  11894. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11895. return c
  11896. }
  11897. // Context sets the context to be used in this call's Do method. Any
  11898. // pending HTTP request will be aborted if the provided context is
  11899. // canceled.
  11900. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsSetManagementCall {
  11901. c.ctx_ = ctx
  11902. return c
  11903. }
  11904. // Header returns an http.Header that can be modified by the caller to
  11905. // add HTTP headers to the request.
  11906. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Header() http.Header {
  11907. if c.header_ == nil {
  11908. c.header_ = make(http.Header)
  11909. }
  11910. return c.header_
  11911. }
  11912. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) doRequest(alt string) (*http.Response, error) {
  11913. reqHeaders := make(http.Header)
  11914. for k, v := range c.header_ {
  11915. reqHeaders[k] = v
  11916. }
  11917. reqHeaders.Set("User-Agent", c.s.userAgent())
  11918. var body io.Reader = nil
  11919. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolmanagementrequest)
  11920. if err != nil {
  11921. return nil, err
  11922. }
  11923. reqHeaders.Set("Content-Type", "application/json")
  11924. c.urlParams_.Set("alt", alt)
  11925. c.urlParams_.Set("prettyPrint", "false")
  11926. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement")
  11927. urls += "?" + c.urlParams_.Encode()
  11928. req, err := http.NewRequest("POST", urls, body)
  11929. if err != nil {
  11930. return nil, err
  11931. }
  11932. req.Header = reqHeaders
  11933. googleapi.Expand(req.URL, map[string]string{
  11934. "projectId": c.projectId,
  11935. "zone": c.zone,
  11936. "clusterId": c.clusterId,
  11937. "nodePoolId": c.nodePoolId,
  11938. })
  11939. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11940. }
  11941. // Do executes the "container.projects.zones.clusters.nodePools.setManagement" call.
  11942. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11943. // status code is an error. Response headers are in either
  11944. // *Operation.ServerResponse.Header or (if a response was returned at
  11945. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11946. // to check whether the returned error was because
  11947. // http.StatusNotModified was returned.
  11948. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11949. gensupport.SetOptions(c.urlParams_, opts...)
  11950. res, err := c.doRequest("json")
  11951. if res != nil && res.StatusCode == http.StatusNotModified {
  11952. if res.Body != nil {
  11953. res.Body.Close()
  11954. }
  11955. return nil, &googleapi.Error{
  11956. Code: res.StatusCode,
  11957. Header: res.Header,
  11958. }
  11959. }
  11960. if err != nil {
  11961. return nil, err
  11962. }
  11963. defer googleapi.CloseBody(res)
  11964. if err := googleapi.CheckResponse(res); err != nil {
  11965. return nil, err
  11966. }
  11967. ret := &Operation{
  11968. ServerResponse: googleapi.ServerResponse{
  11969. Header: res.Header,
  11970. HTTPStatusCode: res.StatusCode,
  11971. },
  11972. }
  11973. target := &ret
  11974. if err := gensupport.DecodeResponse(target, res); err != nil {
  11975. return nil, err
  11976. }
  11977. return ret, nil
  11978. // {
  11979. // "description": "Sets the NodeManagement options for a node pool.",
  11980. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement",
  11981. // "httpMethod": "POST",
  11982. // "id": "container.projects.zones.clusters.nodePools.setManagement",
  11983. // "parameterOrder": [
  11984. // "projectId",
  11985. // "zone",
  11986. // "clusterId",
  11987. // "nodePoolId"
  11988. // ],
  11989. // "parameters": {
  11990. // "clusterId": {
  11991. // "description": "Deprecated. The name of the cluster to update.\nThis field has been deprecated and replaced by the name field.",
  11992. // "location": "path",
  11993. // "required": true,
  11994. // "type": "string"
  11995. // },
  11996. // "nodePoolId": {
  11997. // "description": "Deprecated. The name of the node pool to update.\nThis field has been deprecated and replaced by the name field.",
  11998. // "location": "path",
  11999. // "required": true,
  12000. // "type": "string"
  12001. // },
  12002. // "projectId": {
  12003. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  12004. // "location": "path",
  12005. // "required": true,
  12006. // "type": "string"
  12007. // },
  12008. // "zone": {
  12009. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  12010. // "location": "path",
  12011. // "required": true,
  12012. // "type": "string"
  12013. // }
  12014. // },
  12015. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement",
  12016. // "request": {
  12017. // "$ref": "SetNodePoolManagementRequest"
  12018. // },
  12019. // "response": {
  12020. // "$ref": "Operation"
  12021. // },
  12022. // "scopes": [
  12023. // "https://www.googleapis.com/auth/cloud-platform"
  12024. // ]
  12025. // }
  12026. }
  12027. // method id "container.projects.zones.clusters.nodePools.setSize":
  12028. type ProjectsZonesClustersNodePoolsSetSizeCall struct {
  12029. s *Service
  12030. projectId string
  12031. zone string
  12032. clusterId string
  12033. nodePoolId string
  12034. setnodepoolsizerequest *SetNodePoolSizeRequest
  12035. urlParams_ gensupport.URLParams
  12036. ctx_ context.Context
  12037. header_ http.Header
  12038. }
  12039. // SetSize: Sets the size for a specific node pool.
  12040. func (r *ProjectsZonesClustersNodePoolsService) SetSize(projectId string, zone string, clusterId string, nodePoolId string, setnodepoolsizerequest *SetNodePoolSizeRequest) *ProjectsZonesClustersNodePoolsSetSizeCall {
  12041. c := &ProjectsZonesClustersNodePoolsSetSizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12042. c.projectId = projectId
  12043. c.zone = zone
  12044. c.clusterId = clusterId
  12045. c.nodePoolId = nodePoolId
  12046. c.setnodepoolsizerequest = setnodepoolsizerequest
  12047. return c
  12048. }
  12049. // Fields allows partial responses to be retrieved. See
  12050. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12051. // for more information.
  12052. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsSetSizeCall {
  12053. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12054. return c
  12055. }
  12056. // Context sets the context to be used in this call's Do method. Any
  12057. // pending HTTP request will be aborted if the provided context is
  12058. // canceled.
  12059. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsSetSizeCall {
  12060. c.ctx_ = ctx
  12061. return c
  12062. }
  12063. // Header returns an http.Header that can be modified by the caller to
  12064. // add HTTP headers to the request.
  12065. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Header() http.Header {
  12066. if c.header_ == nil {
  12067. c.header_ = make(http.Header)
  12068. }
  12069. return c.header_
  12070. }
  12071. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) doRequest(alt string) (*http.Response, error) {
  12072. reqHeaders := make(http.Header)
  12073. for k, v := range c.header_ {
  12074. reqHeaders[k] = v
  12075. }
  12076. reqHeaders.Set("User-Agent", c.s.userAgent())
  12077. var body io.Reader = nil
  12078. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolsizerequest)
  12079. if err != nil {
  12080. return nil, err
  12081. }
  12082. reqHeaders.Set("Content-Type", "application/json")
  12083. c.urlParams_.Set("alt", alt)
  12084. c.urlParams_.Set("prettyPrint", "false")
  12085. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize")
  12086. urls += "?" + c.urlParams_.Encode()
  12087. req, err := http.NewRequest("POST", urls, body)
  12088. if err != nil {
  12089. return nil, err
  12090. }
  12091. req.Header = reqHeaders
  12092. googleapi.Expand(req.URL, map[string]string{
  12093. "projectId": c.projectId,
  12094. "zone": c.zone,
  12095. "clusterId": c.clusterId,
  12096. "nodePoolId": c.nodePoolId,
  12097. })
  12098. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12099. }
  12100. // Do executes the "container.projects.zones.clusters.nodePools.setSize" call.
  12101. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12102. // status code is an error. Response headers are in either
  12103. // *Operation.ServerResponse.Header or (if a response was returned at
  12104. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12105. // to check whether the returned error was because
  12106. // http.StatusNotModified was returned.
  12107. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12108. gensupport.SetOptions(c.urlParams_, opts...)
  12109. res, err := c.doRequest("json")
  12110. if res != nil && res.StatusCode == http.StatusNotModified {
  12111. if res.Body != nil {
  12112. res.Body.Close()
  12113. }
  12114. return nil, &googleapi.Error{
  12115. Code: res.StatusCode,
  12116. Header: res.Header,
  12117. }
  12118. }
  12119. if err != nil {
  12120. return nil, err
  12121. }
  12122. defer googleapi.CloseBody(res)
  12123. if err := googleapi.CheckResponse(res); err != nil {
  12124. return nil, err
  12125. }
  12126. ret := &Operation{
  12127. ServerResponse: googleapi.ServerResponse{
  12128. Header: res.Header,
  12129. HTTPStatusCode: res.StatusCode,
  12130. },
  12131. }
  12132. target := &ret
  12133. if err := gensupport.DecodeResponse(target, res); err != nil {
  12134. return nil, err
  12135. }
  12136. return ret, nil
  12137. // {
  12138. // "description": "Sets the size for a specific node pool.",
  12139. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize",
  12140. // "httpMethod": "POST",
  12141. // "id": "container.projects.zones.clusters.nodePools.setSize",
  12142. // "parameterOrder": [
  12143. // "projectId",
  12144. // "zone",
  12145. // "clusterId",
  12146. // "nodePoolId"
  12147. // ],
  12148. // "parameters": {
  12149. // "clusterId": {
  12150. // "description": "Deprecated. The name of the cluster to update.\nThis field has been deprecated and replaced by the name field.",
  12151. // "location": "path",
  12152. // "required": true,
  12153. // "type": "string"
  12154. // },
  12155. // "nodePoolId": {
  12156. // "description": "Deprecated. The name of the node pool to update.\nThis field has been deprecated and replaced by the name field.",
  12157. // "location": "path",
  12158. // "required": true,
  12159. // "type": "string"
  12160. // },
  12161. // "projectId": {
  12162. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  12163. // "location": "path",
  12164. // "required": true,
  12165. // "type": "string"
  12166. // },
  12167. // "zone": {
  12168. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  12169. // "location": "path",
  12170. // "required": true,
  12171. // "type": "string"
  12172. // }
  12173. // },
  12174. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize",
  12175. // "request": {
  12176. // "$ref": "SetNodePoolSizeRequest"
  12177. // },
  12178. // "response": {
  12179. // "$ref": "Operation"
  12180. // },
  12181. // "scopes": [
  12182. // "https://www.googleapis.com/auth/cloud-platform"
  12183. // ]
  12184. // }
  12185. }
  12186. // method id "container.projects.zones.clusters.nodePools.update":
  12187. type ProjectsZonesClustersNodePoolsUpdateCall struct {
  12188. s *Service
  12189. projectId string
  12190. zone string
  12191. clusterId string
  12192. nodePoolId string
  12193. updatenodepoolrequest *UpdateNodePoolRequest
  12194. urlParams_ gensupport.URLParams
  12195. ctx_ context.Context
  12196. header_ http.Header
  12197. }
  12198. // Update: Updates the version and/or image type for the specified node
  12199. // pool.
  12200. func (r *ProjectsZonesClustersNodePoolsService) Update(projectId string, zone string, clusterId string, nodePoolId string, updatenodepoolrequest *UpdateNodePoolRequest) *ProjectsZonesClustersNodePoolsUpdateCall {
  12201. c := &ProjectsZonesClustersNodePoolsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12202. c.projectId = projectId
  12203. c.zone = zone
  12204. c.clusterId = clusterId
  12205. c.nodePoolId = nodePoolId
  12206. c.updatenodepoolrequest = updatenodepoolrequest
  12207. return c
  12208. }
  12209. // Fields allows partial responses to be retrieved. See
  12210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12211. // for more information.
  12212. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsUpdateCall {
  12213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12214. return c
  12215. }
  12216. // Context sets the context to be used in this call's Do method. Any
  12217. // pending HTTP request will be aborted if the provided context is
  12218. // canceled.
  12219. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsUpdateCall {
  12220. c.ctx_ = ctx
  12221. return c
  12222. }
  12223. // Header returns an http.Header that can be modified by the caller to
  12224. // add HTTP headers to the request.
  12225. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Header() http.Header {
  12226. if c.header_ == nil {
  12227. c.header_ = make(http.Header)
  12228. }
  12229. return c.header_
  12230. }
  12231. func (c *ProjectsZonesClustersNodePoolsUpdateCall) doRequest(alt string) (*http.Response, error) {
  12232. reqHeaders := make(http.Header)
  12233. for k, v := range c.header_ {
  12234. reqHeaders[k] = v
  12235. }
  12236. reqHeaders.Set("User-Agent", c.s.userAgent())
  12237. var body io.Reader = nil
  12238. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatenodepoolrequest)
  12239. if err != nil {
  12240. return nil, err
  12241. }
  12242. reqHeaders.Set("Content-Type", "application/json")
  12243. c.urlParams_.Set("alt", alt)
  12244. c.urlParams_.Set("prettyPrint", "false")
  12245. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update")
  12246. urls += "?" + c.urlParams_.Encode()
  12247. req, err := http.NewRequest("POST", urls, body)
  12248. if err != nil {
  12249. return nil, err
  12250. }
  12251. req.Header = reqHeaders
  12252. googleapi.Expand(req.URL, map[string]string{
  12253. "projectId": c.projectId,
  12254. "zone": c.zone,
  12255. "clusterId": c.clusterId,
  12256. "nodePoolId": c.nodePoolId,
  12257. })
  12258. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12259. }
  12260. // Do executes the "container.projects.zones.clusters.nodePools.update" call.
  12261. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12262. // status code is an error. Response headers are in either
  12263. // *Operation.ServerResponse.Header or (if a response was returned at
  12264. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12265. // to check whether the returned error was because
  12266. // http.StatusNotModified was returned.
  12267. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12268. gensupport.SetOptions(c.urlParams_, opts...)
  12269. res, err := c.doRequest("json")
  12270. if res != nil && res.StatusCode == http.StatusNotModified {
  12271. if res.Body != nil {
  12272. res.Body.Close()
  12273. }
  12274. return nil, &googleapi.Error{
  12275. Code: res.StatusCode,
  12276. Header: res.Header,
  12277. }
  12278. }
  12279. if err != nil {
  12280. return nil, err
  12281. }
  12282. defer googleapi.CloseBody(res)
  12283. if err := googleapi.CheckResponse(res); err != nil {
  12284. return nil, err
  12285. }
  12286. ret := &Operation{
  12287. ServerResponse: googleapi.ServerResponse{
  12288. Header: res.Header,
  12289. HTTPStatusCode: res.StatusCode,
  12290. },
  12291. }
  12292. target := &ret
  12293. if err := gensupport.DecodeResponse(target, res); err != nil {
  12294. return nil, err
  12295. }
  12296. return ret, nil
  12297. // {
  12298. // "description": "Updates the version and/or image type for the specified node pool.",
  12299. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update",
  12300. // "httpMethod": "POST",
  12301. // "id": "container.projects.zones.clusters.nodePools.update",
  12302. // "parameterOrder": [
  12303. // "projectId",
  12304. // "zone",
  12305. // "clusterId",
  12306. // "nodePoolId"
  12307. // ],
  12308. // "parameters": {
  12309. // "clusterId": {
  12310. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  12311. // "location": "path",
  12312. // "required": true,
  12313. // "type": "string"
  12314. // },
  12315. // "nodePoolId": {
  12316. // "description": "Deprecated. The name of the node pool to upgrade.\nThis field has been deprecated and replaced by the name field.",
  12317. // "location": "path",
  12318. // "required": true,
  12319. // "type": "string"
  12320. // },
  12321. // "projectId": {
  12322. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  12323. // "location": "path",
  12324. // "required": true,
  12325. // "type": "string"
  12326. // },
  12327. // "zone": {
  12328. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  12329. // "location": "path",
  12330. // "required": true,
  12331. // "type": "string"
  12332. // }
  12333. // },
  12334. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update",
  12335. // "request": {
  12336. // "$ref": "UpdateNodePoolRequest"
  12337. // },
  12338. // "response": {
  12339. // "$ref": "Operation"
  12340. // },
  12341. // "scopes": [
  12342. // "https://www.googleapis.com/auth/cloud-platform"
  12343. // ]
  12344. // }
  12345. }
  12346. // method id "container.projects.zones.operations.cancel":
  12347. type ProjectsZonesOperationsCancelCall struct {
  12348. s *Service
  12349. projectId string
  12350. zone string
  12351. operationId string
  12352. canceloperationrequest *CancelOperationRequest
  12353. urlParams_ gensupport.URLParams
  12354. ctx_ context.Context
  12355. header_ http.Header
  12356. }
  12357. // Cancel: Cancels the specified operation.
  12358. func (r *ProjectsZonesOperationsService) Cancel(projectId string, zone string, operationId string, canceloperationrequest *CancelOperationRequest) *ProjectsZonesOperationsCancelCall {
  12359. c := &ProjectsZonesOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12360. c.projectId = projectId
  12361. c.zone = zone
  12362. c.operationId = operationId
  12363. c.canceloperationrequest = canceloperationrequest
  12364. return c
  12365. }
  12366. // Fields allows partial responses to be retrieved. See
  12367. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12368. // for more information.
  12369. func (c *ProjectsZonesOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsCancelCall {
  12370. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12371. return c
  12372. }
  12373. // Context sets the context to be used in this call's Do method. Any
  12374. // pending HTTP request will be aborted if the provided context is
  12375. // canceled.
  12376. func (c *ProjectsZonesOperationsCancelCall) Context(ctx context.Context) *ProjectsZonesOperationsCancelCall {
  12377. c.ctx_ = ctx
  12378. return c
  12379. }
  12380. // Header returns an http.Header that can be modified by the caller to
  12381. // add HTTP headers to the request.
  12382. func (c *ProjectsZonesOperationsCancelCall) Header() http.Header {
  12383. if c.header_ == nil {
  12384. c.header_ = make(http.Header)
  12385. }
  12386. return c.header_
  12387. }
  12388. func (c *ProjectsZonesOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  12389. reqHeaders := make(http.Header)
  12390. for k, v := range c.header_ {
  12391. reqHeaders[k] = v
  12392. }
  12393. reqHeaders.Set("User-Agent", c.s.userAgent())
  12394. var body io.Reader = nil
  12395. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  12396. if err != nil {
  12397. return nil, err
  12398. }
  12399. reqHeaders.Set("Content-Type", "application/json")
  12400. c.urlParams_.Set("alt", alt)
  12401. c.urlParams_.Set("prettyPrint", "false")
  12402. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel")
  12403. urls += "?" + c.urlParams_.Encode()
  12404. req, err := http.NewRequest("POST", urls, body)
  12405. if err != nil {
  12406. return nil, err
  12407. }
  12408. req.Header = reqHeaders
  12409. googleapi.Expand(req.URL, map[string]string{
  12410. "projectId": c.projectId,
  12411. "zone": c.zone,
  12412. "operationId": c.operationId,
  12413. })
  12414. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12415. }
  12416. // Do executes the "container.projects.zones.operations.cancel" call.
  12417. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  12418. // code is an error. Response headers are in either
  12419. // *Empty.ServerResponse.Header or (if a response was returned at all)
  12420. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12421. // check whether the returned error was because http.StatusNotModified
  12422. // was returned.
  12423. func (c *ProjectsZonesOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  12424. gensupport.SetOptions(c.urlParams_, opts...)
  12425. res, err := c.doRequest("json")
  12426. if res != nil && res.StatusCode == http.StatusNotModified {
  12427. if res.Body != nil {
  12428. res.Body.Close()
  12429. }
  12430. return nil, &googleapi.Error{
  12431. Code: res.StatusCode,
  12432. Header: res.Header,
  12433. }
  12434. }
  12435. if err != nil {
  12436. return nil, err
  12437. }
  12438. defer googleapi.CloseBody(res)
  12439. if err := googleapi.CheckResponse(res); err != nil {
  12440. return nil, err
  12441. }
  12442. ret := &Empty{
  12443. ServerResponse: googleapi.ServerResponse{
  12444. Header: res.Header,
  12445. HTTPStatusCode: res.StatusCode,
  12446. },
  12447. }
  12448. target := &ret
  12449. if err := gensupport.DecodeResponse(target, res); err != nil {
  12450. return nil, err
  12451. }
  12452. return ret, nil
  12453. // {
  12454. // "description": "Cancels the specified operation.",
  12455. // "flatPath": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel",
  12456. // "httpMethod": "POST",
  12457. // "id": "container.projects.zones.operations.cancel",
  12458. // "parameterOrder": [
  12459. // "projectId",
  12460. // "zone",
  12461. // "operationId"
  12462. // ],
  12463. // "parameters": {
  12464. // "operationId": {
  12465. // "description": "Deprecated. The server-assigned `name` of the operation.\nThis field has been deprecated and replaced by the name field.",
  12466. // "location": "path",
  12467. // "required": true,
  12468. // "type": "string"
  12469. // },
  12470. // "projectId": {
  12471. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  12472. // "location": "path",
  12473. // "required": true,
  12474. // "type": "string"
  12475. // },
  12476. // "zone": {
  12477. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the operation resides.\nThis field has been deprecated and replaced by the name field.",
  12478. // "location": "path",
  12479. // "required": true,
  12480. // "type": "string"
  12481. // }
  12482. // },
  12483. // "path": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel",
  12484. // "request": {
  12485. // "$ref": "CancelOperationRequest"
  12486. // },
  12487. // "response": {
  12488. // "$ref": "Empty"
  12489. // },
  12490. // "scopes": [
  12491. // "https://www.googleapis.com/auth/cloud-platform"
  12492. // ]
  12493. // }
  12494. }
  12495. // method id "container.projects.zones.operations.get":
  12496. type ProjectsZonesOperationsGetCall struct {
  12497. s *Service
  12498. projectId string
  12499. zone string
  12500. operationId string
  12501. urlParams_ gensupport.URLParams
  12502. ifNoneMatch_ string
  12503. ctx_ context.Context
  12504. header_ http.Header
  12505. }
  12506. // Get: Gets the specified operation.
  12507. func (r *ProjectsZonesOperationsService) Get(projectId string, zone string, operationId string) *ProjectsZonesOperationsGetCall {
  12508. c := &ProjectsZonesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12509. c.projectId = projectId
  12510. c.zone = zone
  12511. c.operationId = operationId
  12512. return c
  12513. }
  12514. // Name sets the optional parameter "name": The name (project, location,
  12515. // operation id) of the operation to get.
  12516. // Specified in the format 'projects/*/locations/*/operations/*'.
  12517. func (c *ProjectsZonesOperationsGetCall) Name(name string) *ProjectsZonesOperationsGetCall {
  12518. c.urlParams_.Set("name", name)
  12519. return c
  12520. }
  12521. // Fields allows partial responses to be retrieved. See
  12522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12523. // for more information.
  12524. func (c *ProjectsZonesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsGetCall {
  12525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12526. return c
  12527. }
  12528. // IfNoneMatch sets the optional parameter which makes the operation
  12529. // fail if the object's ETag matches the given value. This is useful for
  12530. // getting updates only after the object has changed since the last
  12531. // request. Use googleapi.IsNotModified to check whether the response
  12532. // error from Do is the result of In-None-Match.
  12533. func (c *ProjectsZonesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsZonesOperationsGetCall {
  12534. c.ifNoneMatch_ = entityTag
  12535. return c
  12536. }
  12537. // Context sets the context to be used in this call's Do method. Any
  12538. // pending HTTP request will be aborted if the provided context is
  12539. // canceled.
  12540. func (c *ProjectsZonesOperationsGetCall) Context(ctx context.Context) *ProjectsZonesOperationsGetCall {
  12541. c.ctx_ = ctx
  12542. return c
  12543. }
  12544. // Header returns an http.Header that can be modified by the caller to
  12545. // add HTTP headers to the request.
  12546. func (c *ProjectsZonesOperationsGetCall) Header() http.Header {
  12547. if c.header_ == nil {
  12548. c.header_ = make(http.Header)
  12549. }
  12550. return c.header_
  12551. }
  12552. func (c *ProjectsZonesOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  12553. reqHeaders := make(http.Header)
  12554. for k, v := range c.header_ {
  12555. reqHeaders[k] = v
  12556. }
  12557. reqHeaders.Set("User-Agent", c.s.userAgent())
  12558. if c.ifNoneMatch_ != "" {
  12559. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12560. }
  12561. var body io.Reader = nil
  12562. c.urlParams_.Set("alt", alt)
  12563. c.urlParams_.Set("prettyPrint", "false")
  12564. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/operations/{operationId}")
  12565. urls += "?" + c.urlParams_.Encode()
  12566. req, err := http.NewRequest("GET", urls, body)
  12567. if err != nil {
  12568. return nil, err
  12569. }
  12570. req.Header = reqHeaders
  12571. googleapi.Expand(req.URL, map[string]string{
  12572. "projectId": c.projectId,
  12573. "zone": c.zone,
  12574. "operationId": c.operationId,
  12575. })
  12576. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12577. }
  12578. // Do executes the "container.projects.zones.operations.get" call.
  12579. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12580. // status code is an error. Response headers are in either
  12581. // *Operation.ServerResponse.Header or (if a response was returned at
  12582. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12583. // to check whether the returned error was because
  12584. // http.StatusNotModified was returned.
  12585. func (c *ProjectsZonesOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12586. gensupport.SetOptions(c.urlParams_, opts...)
  12587. res, err := c.doRequest("json")
  12588. if res != nil && res.StatusCode == http.StatusNotModified {
  12589. if res.Body != nil {
  12590. res.Body.Close()
  12591. }
  12592. return nil, &googleapi.Error{
  12593. Code: res.StatusCode,
  12594. Header: res.Header,
  12595. }
  12596. }
  12597. if err != nil {
  12598. return nil, err
  12599. }
  12600. defer googleapi.CloseBody(res)
  12601. if err := googleapi.CheckResponse(res); err != nil {
  12602. return nil, err
  12603. }
  12604. ret := &Operation{
  12605. ServerResponse: googleapi.ServerResponse{
  12606. Header: res.Header,
  12607. HTTPStatusCode: res.StatusCode,
  12608. },
  12609. }
  12610. target := &ret
  12611. if err := gensupport.DecodeResponse(target, res); err != nil {
  12612. return nil, err
  12613. }
  12614. return ret, nil
  12615. // {
  12616. // "description": "Gets the specified operation.",
  12617. // "flatPath": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}",
  12618. // "httpMethod": "GET",
  12619. // "id": "container.projects.zones.operations.get",
  12620. // "parameterOrder": [
  12621. // "projectId",
  12622. // "zone",
  12623. // "operationId"
  12624. // ],
  12625. // "parameters": {
  12626. // "name": {
  12627. // "description": "The name (project, location, operation id) of the operation to get.\nSpecified in the format 'projects/*/locations/*/operations/*'.",
  12628. // "location": "query",
  12629. // "type": "string"
  12630. // },
  12631. // "operationId": {
  12632. // "description": "Deprecated. The server-assigned `name` of the operation.\nThis field has been deprecated and replaced by the name field.",
  12633. // "location": "path",
  12634. // "required": true,
  12635. // "type": "string"
  12636. // },
  12637. // "projectId": {
  12638. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  12639. // "location": "path",
  12640. // "required": true,
  12641. // "type": "string"
  12642. // },
  12643. // "zone": {
  12644. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  12645. // "location": "path",
  12646. // "required": true,
  12647. // "type": "string"
  12648. // }
  12649. // },
  12650. // "path": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}",
  12651. // "response": {
  12652. // "$ref": "Operation"
  12653. // },
  12654. // "scopes": [
  12655. // "https://www.googleapis.com/auth/cloud-platform"
  12656. // ]
  12657. // }
  12658. }
  12659. // method id "container.projects.zones.operations.list":
  12660. type ProjectsZonesOperationsListCall struct {
  12661. s *Service
  12662. projectId string
  12663. zone string
  12664. urlParams_ gensupport.URLParams
  12665. ifNoneMatch_ string
  12666. ctx_ context.Context
  12667. header_ http.Header
  12668. }
  12669. // List: Lists all operations in a project in a specific zone or all
  12670. // zones.
  12671. func (r *ProjectsZonesOperationsService) List(projectId string, zone string) *ProjectsZonesOperationsListCall {
  12672. c := &ProjectsZonesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12673. c.projectId = projectId
  12674. c.zone = zone
  12675. return c
  12676. }
  12677. // Parent sets the optional parameter "parent": The parent (project and
  12678. // location) where the operations will be listed.
  12679. // Specified in the format 'projects/*/locations/*'.
  12680. // Location "-" matches all zones and all regions.
  12681. func (c *ProjectsZonesOperationsListCall) Parent(parent string) *ProjectsZonesOperationsListCall {
  12682. c.urlParams_.Set("parent", parent)
  12683. return c
  12684. }
  12685. // Fields allows partial responses to be retrieved. See
  12686. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12687. // for more information.
  12688. func (c *ProjectsZonesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsListCall {
  12689. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12690. return c
  12691. }
  12692. // IfNoneMatch sets the optional parameter which makes the operation
  12693. // fail if the object's ETag matches the given value. This is useful for
  12694. // getting updates only after the object has changed since the last
  12695. // request. Use googleapi.IsNotModified to check whether the response
  12696. // error from Do is the result of In-None-Match.
  12697. func (c *ProjectsZonesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsZonesOperationsListCall {
  12698. c.ifNoneMatch_ = entityTag
  12699. return c
  12700. }
  12701. // Context sets the context to be used in this call's Do method. Any
  12702. // pending HTTP request will be aborted if the provided context is
  12703. // canceled.
  12704. func (c *ProjectsZonesOperationsListCall) Context(ctx context.Context) *ProjectsZonesOperationsListCall {
  12705. c.ctx_ = ctx
  12706. return c
  12707. }
  12708. // Header returns an http.Header that can be modified by the caller to
  12709. // add HTTP headers to the request.
  12710. func (c *ProjectsZonesOperationsListCall) Header() http.Header {
  12711. if c.header_ == nil {
  12712. c.header_ = make(http.Header)
  12713. }
  12714. return c.header_
  12715. }
  12716. func (c *ProjectsZonesOperationsListCall) doRequest(alt string) (*http.Response, error) {
  12717. reqHeaders := make(http.Header)
  12718. for k, v := range c.header_ {
  12719. reqHeaders[k] = v
  12720. }
  12721. reqHeaders.Set("User-Agent", c.s.userAgent())
  12722. if c.ifNoneMatch_ != "" {
  12723. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12724. }
  12725. var body io.Reader = nil
  12726. c.urlParams_.Set("alt", alt)
  12727. c.urlParams_.Set("prettyPrint", "false")
  12728. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/operations")
  12729. urls += "?" + c.urlParams_.Encode()
  12730. req, err := http.NewRequest("GET", urls, body)
  12731. if err != nil {
  12732. return nil, err
  12733. }
  12734. req.Header = reqHeaders
  12735. googleapi.Expand(req.URL, map[string]string{
  12736. "projectId": c.projectId,
  12737. "zone": c.zone,
  12738. })
  12739. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12740. }
  12741. // Do executes the "container.projects.zones.operations.list" call.
  12742. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  12743. // non-2xx status code is an error. Response headers are in either
  12744. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  12745. // returned at all) in error.(*googleapi.Error).Header. Use
  12746. // googleapi.IsNotModified to check whether the returned error was
  12747. // because http.StatusNotModified was returned.
  12748. func (c *ProjectsZonesOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  12749. gensupport.SetOptions(c.urlParams_, opts...)
  12750. res, err := c.doRequest("json")
  12751. if res != nil && res.StatusCode == http.StatusNotModified {
  12752. if res.Body != nil {
  12753. res.Body.Close()
  12754. }
  12755. return nil, &googleapi.Error{
  12756. Code: res.StatusCode,
  12757. Header: res.Header,
  12758. }
  12759. }
  12760. if err != nil {
  12761. return nil, err
  12762. }
  12763. defer googleapi.CloseBody(res)
  12764. if err := googleapi.CheckResponse(res); err != nil {
  12765. return nil, err
  12766. }
  12767. ret := &ListOperationsResponse{
  12768. ServerResponse: googleapi.ServerResponse{
  12769. Header: res.Header,
  12770. HTTPStatusCode: res.StatusCode,
  12771. },
  12772. }
  12773. target := &ret
  12774. if err := gensupport.DecodeResponse(target, res); err != nil {
  12775. return nil, err
  12776. }
  12777. return ret, nil
  12778. // {
  12779. // "description": "Lists all operations in a project in a specific zone or all zones.",
  12780. // "flatPath": "v1/projects/{projectId}/zones/{zone}/operations",
  12781. // "httpMethod": "GET",
  12782. // "id": "container.projects.zones.operations.list",
  12783. // "parameterOrder": [
  12784. // "projectId",
  12785. // "zone"
  12786. // ],
  12787. // "parameters": {
  12788. // "parent": {
  12789. // "description": "The parent (project and location) where the operations will be listed.\nSpecified in the format 'projects/*/locations/*'.\nLocation \"-\" matches all zones and all regions.",
  12790. // "location": "query",
  12791. // "type": "string"
  12792. // },
  12793. // "projectId": {
  12794. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the parent field.",
  12795. // "location": "path",
  12796. // "required": true,
  12797. // "type": "string"
  12798. // },
  12799. // "zone": {
  12800. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) to return operations for, or `-` for\nall zones. This field has been deprecated and replaced by the parent field.",
  12801. // "location": "path",
  12802. // "required": true,
  12803. // "type": "string"
  12804. // }
  12805. // },
  12806. // "path": "v1/projects/{projectId}/zones/{zone}/operations",
  12807. // "response": {
  12808. // "$ref": "ListOperationsResponse"
  12809. // },
  12810. // "scopes": [
  12811. // "https://www.googleapis.com/auth/cloud-platform"
  12812. // ]
  12813. // }
  12814. }