dataproc-gen.go 175 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958
  1. // Package dataproc provides access to the Google Cloud Dataproc API.
  2. //
  3. // See https://cloud.google.com/dataproc/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/dataproc/v1alpha1"
  8. // ...
  9. // dataprocService, err := dataproc.New(oauthHttpClient)
  10. package dataproc // import "google.golang.org/api/dataproc/v1alpha1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "dataproc:v1alpha1"
  41. const apiName = "dataproc"
  42. const apiVersion = "v1alpha1"
  43. const basePath = "https://dataproc.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. // Administrate log data for your projects
  49. LoggingAdminScope = "https://www.googleapis.com/auth/logging.admin"
  50. // View log data for your projects
  51. LoggingReadScope = "https://www.googleapis.com/auth/logging.read"
  52. // Submit log data for your projects
  53. LoggingWriteScope = "https://www.googleapis.com/auth/logging.write"
  54. )
  55. func New(client *http.Client) (*Service, error) {
  56. if client == nil {
  57. return nil, errors.New("client is nil")
  58. }
  59. s := &Service{client: client, BasePath: basePath}
  60. s.Operations = NewOperationsService(s)
  61. s.Projects = NewProjectsService(s)
  62. return s, nil
  63. }
  64. type Service struct {
  65. client *http.Client
  66. BasePath string // API endpoint base URL
  67. UserAgent string // optional additional User-Agent fragment
  68. Operations *OperationsService
  69. Projects *ProjectsService
  70. }
  71. func (s *Service) userAgent() string {
  72. if s.UserAgent == "" {
  73. return googleapi.UserAgent
  74. }
  75. return googleapi.UserAgent + " " + s.UserAgent
  76. }
  77. func NewOperationsService(s *Service) *OperationsService {
  78. rs := &OperationsService{s: s}
  79. return rs
  80. }
  81. type OperationsService struct {
  82. s *Service
  83. }
  84. func NewProjectsService(s *Service) *ProjectsService {
  85. rs := &ProjectsService{s: s}
  86. rs.Clusters = NewProjectsClustersService(s)
  87. rs.Jobs = NewProjectsJobsService(s)
  88. return rs
  89. }
  90. type ProjectsService struct {
  91. s *Service
  92. Clusters *ProjectsClustersService
  93. Jobs *ProjectsJobsService
  94. }
  95. func NewProjectsClustersService(s *Service) *ProjectsClustersService {
  96. rs := &ProjectsClustersService{s: s}
  97. rs.Agents = NewProjectsClustersAgentsService(s)
  98. rs.Tasks = NewProjectsClustersTasksService(s)
  99. return rs
  100. }
  101. type ProjectsClustersService struct {
  102. s *Service
  103. Agents *ProjectsClustersAgentsService
  104. Tasks *ProjectsClustersTasksService
  105. }
  106. func NewProjectsClustersAgentsService(s *Service) *ProjectsClustersAgentsService {
  107. rs := &ProjectsClustersAgentsService{s: s}
  108. return rs
  109. }
  110. type ProjectsClustersAgentsService struct {
  111. s *Service
  112. }
  113. func NewProjectsClustersTasksService(s *Service) *ProjectsClustersTasksService {
  114. rs := &ProjectsClustersTasksService{s: s}
  115. return rs
  116. }
  117. type ProjectsClustersTasksService struct {
  118. s *Service
  119. }
  120. func NewProjectsJobsService(s *Service) *ProjectsJobsService {
  121. rs := &ProjectsJobsService{s: s}
  122. return rs
  123. }
  124. type ProjectsJobsService struct {
  125. s *Service
  126. }
  127. // Agent: A record for a single agent within Dataproc.
  128. type Agent struct {
  129. // AgentId: [Required] 64 characters matching the regular expression:
  130. // [a-z0-9.-]{1,64} An agent chosen ID. This should typically be the
  131. // hostname of the GCE virtual machine on which the agent is currently
  132. // running.
  133. AgentId string `json:"agentId,omitempty"`
  134. // AgentVersion: The version of this agent in HTTP User-Agent Header
  135. // value format (RFC 2616 section 14.43), e.g., "Dataproc-Agent/1.2".
  136. AgentVersion string `json:"agentVersion,omitempty"`
  137. // LastAgentUpdateTime: [Out] the last time this agent checked-in with
  138. // Dataproc.
  139. LastAgentUpdateTime string `json:"lastAgentUpdateTime,omitempty"`
  140. // Status: Agent status.
  141. //
  142. // Possible values:
  143. // "STATUS_UNKNOWN"
  144. // "INITIALIZING"
  145. // "PERFORMING_CUSTOM_INITIALIZATION_ACTIONS"
  146. // "RUNNING"
  147. // "SETUP_FAILED"
  148. Status string `json:"status,omitempty"`
  149. // ServerResponse contains the HTTP response code and headers from the
  150. // server.
  151. googleapi.ServerResponse `json:"-"`
  152. // ForceSendFields is a list of field names (e.g. "AgentId") to
  153. // unconditionally include in API requests. By default, fields with
  154. // empty values are omitted from API requests. However, any non-pointer,
  155. // non-interface field appearing in ForceSendFields will be sent to the
  156. // server regardless of whether the field is empty or not. This may be
  157. // used to include empty fields in Patch requests.
  158. ForceSendFields []string `json:"-"`
  159. }
  160. func (s *Agent) MarshalJSON() ([]byte, error) {
  161. type noMethod Agent
  162. raw := noMethod(*s)
  163. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  164. }
  165. // CancelJobRequest: A request to cancel a job.
  166. type CancelJobRequest struct {
  167. }
  168. // CancelOperationRequest: The request message for
  169. // Operations.CancelOperation.
  170. type CancelOperationRequest struct {
  171. }
  172. // Cluster: Describes the identifying information, configuration, and
  173. // status of a cluster of Google Compute Engine instances.
  174. type Cluster struct {
  175. // ClusterName: [Required] The cluster name. Cluster names within a
  176. // project must be unique. Names from deleted clusters can be reused.
  177. ClusterName string `json:"clusterName,omitempty"`
  178. // ClusterUuid: [Output-only] A cluster UUID (Unique Universal
  179. // Identifier). Cloud Dataproc generates this value when it creates the
  180. // cluster.
  181. ClusterUuid string `json:"clusterUuid,omitempty"`
  182. // Configuration: [Required] The cluster configuration. It may differ
  183. // from a user's initial configuration due to Cloud Dataproc setting of
  184. // default values and updating clusters.
  185. Configuration *ClusterConfiguration `json:"configuration,omitempty"`
  186. // CreateTime: [Output-only] The timestamp of cluster creation.
  187. CreateTime string `json:"createTime,omitempty"`
  188. // ProjectId: [Required] The Google Cloud Platform project ID that the
  189. // cluster belongs to.
  190. ProjectId string `json:"projectId,omitempty"`
  191. // Status: [Output-only] Cluster status.
  192. Status *ClusterStatus `json:"status,omitempty"`
  193. // StatusHistory: [Output-only] Previous cluster statuses.
  194. StatusHistory []*ClusterStatus `json:"statusHistory,omitempty"`
  195. // ServerResponse contains the HTTP response code and headers from the
  196. // server.
  197. googleapi.ServerResponse `json:"-"`
  198. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  199. // unconditionally include in API requests. By default, fields with
  200. // empty values are omitted from API requests. However, any non-pointer,
  201. // non-interface field appearing in ForceSendFields will be sent to the
  202. // server regardless of whether the field is empty or not. This may be
  203. // used to include empty fields in Patch requests.
  204. ForceSendFields []string `json:"-"`
  205. }
  206. func (s *Cluster) MarshalJSON() ([]byte, error) {
  207. type noMethod Cluster
  208. raw := noMethod(*s)
  209. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  210. }
  211. // ClusterConfiguration: The cluster configuration.
  212. type ClusterConfiguration struct {
  213. // ConfigurationBucket: [Optional] A Google Cloud Storage staging bucket
  214. // used for sharing generated SSH keys and configuration. If you do not
  215. // specify a staging bucket, Cloud Dataproc will determine an
  216. // appropriate Cloud Storage location (US, ASIA, or EU) for your
  217. // cluster's staging bucket according to the Google Compute Engine zone
  218. // where your cluster is deployed, then it will create and manage this
  219. // project-level, per-location bucket for you.
  220. ConfigurationBucket string `json:"configurationBucket,omitempty"`
  221. // GceClusterConfiguration: [Optional] The shared Google Compute Engine
  222. // configuration settings for all instances in a cluster.
  223. GceClusterConfiguration *GceClusterConfiguration `json:"gceClusterConfiguration,omitempty"`
  224. // GceConfiguration: [Deprecated] The Google Compute Engine
  225. // configuration settings for cluster resources.
  226. GceConfiguration *GceConfiguration `json:"gceConfiguration,omitempty"`
  227. // InitializationActions: [Optional] Commands to execute on each node
  228. // after configuration is completed. By default, executables are run on
  229. // master and all worker nodes. You can test a node's role metadata to
  230. // run an executable on a master or worker node, as shown below:
  231. // ROLE=$(/usr/share/google/get_metadata_value attributes/role) if [[
  232. // "${ROLE}" == 'Master' ]]; then ... master specific actions ... else
  233. // ... worker specific actions ... fi
  234. InitializationActions []*NodeInitializationAction `json:"initializationActions,omitempty"`
  235. // MasterConfiguration: [Optional] The Google Compute Engine
  236. // configuration settings for the master instance in a cluster.
  237. MasterConfiguration *InstanceGroupConfiguration `json:"masterConfiguration,omitempty"`
  238. // MasterDiskConfiguration: [Deprecated] The configuration settings of
  239. // master node disk options.
  240. MasterDiskConfiguration *DiskConfiguration `json:"masterDiskConfiguration,omitempty"`
  241. // MasterName: [Deprecated] The Master's hostname. Dataproc derives the
  242. // name from cluster_name if not set by user (recommended practice is to
  243. // let Dataproc derive the name). Derived master name example: hadoop-m.
  244. MasterName string `json:"masterName,omitempty"`
  245. // NumWorkers: [Deprecated] The number of worker nodes in the cluster.
  246. NumWorkers int64 `json:"numWorkers,omitempty"`
  247. // SecondaryWorkerConfiguration: [Optional] The Google Compute Engine
  248. // configuration settings for additional worker instances in a cluster.
  249. SecondaryWorkerConfiguration *InstanceGroupConfiguration `json:"secondaryWorkerConfiguration,omitempty"`
  250. // SoftwareConfiguration: [Optional] The configuration settings for
  251. // software inside the cluster.
  252. SoftwareConfiguration *SoftwareConfiguration `json:"softwareConfiguration,omitempty"`
  253. // WorkerConfiguration: [Optional] The Google Compute Engine
  254. // configuration settings for worker instances in a cluster.
  255. WorkerConfiguration *InstanceGroupConfiguration `json:"workerConfiguration,omitempty"`
  256. // WorkerDiskConfiguration: [Deprecated] The configuration settings of
  257. // worker node disk options.
  258. WorkerDiskConfiguration *DiskConfiguration `json:"workerDiskConfiguration,omitempty"`
  259. // Workers: [Deprecated] The list of worker node names. Dataproc derives
  260. // the names from cluster_name and num_workers if not set by user
  261. // (recommended practice is to let Dataproc derive the name). Derived
  262. // worker node name example: hadoop-w-0.
  263. Workers []string `json:"workers,omitempty"`
  264. // ForceSendFields is a list of field names (e.g. "ConfigurationBucket")
  265. // to unconditionally include in API requests. By default, fields with
  266. // empty values are omitted from API requests. However, any non-pointer,
  267. // non-interface field appearing in ForceSendFields will be sent to the
  268. // server regardless of whether the field is empty or not. This may be
  269. // used to include empty fields in Patch requests.
  270. ForceSendFields []string `json:"-"`
  271. }
  272. func (s *ClusterConfiguration) MarshalJSON() ([]byte, error) {
  273. type noMethod ClusterConfiguration
  274. raw := noMethod(*s)
  275. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  276. }
  277. // ClusterStatus: The status of a cluster and its instances.
  278. type ClusterStatus struct {
  279. // Detail: Optional details of cluster's state.
  280. Detail string `json:"detail,omitempty"`
  281. // State: The cluster's state.
  282. //
  283. // Possible values:
  284. // "UNKNOWN"
  285. // "CREATING"
  286. // "RUNNING"
  287. // "ERROR"
  288. // "DELETING"
  289. // "UPDATING"
  290. State string `json:"state,omitempty"`
  291. // StateStartTime: Time when this state was entered.
  292. StateStartTime string `json:"stateStartTime,omitempty"`
  293. // ForceSendFields is a list of field names (e.g. "Detail") to
  294. // unconditionally include in API requests. By default, fields with
  295. // empty values are omitted from API requests. However, any non-pointer,
  296. // non-interface field appearing in ForceSendFields will be sent to the
  297. // server regardless of whether the field is empty or not. This may be
  298. // used to include empty fields in Patch requests.
  299. ForceSendFields []string `json:"-"`
  300. }
  301. func (s *ClusterStatus) MarshalJSON() ([]byte, error) {
  302. type noMethod ClusterStatus
  303. raw := noMethod(*s)
  304. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  305. }
  306. // DiagnoseClusterOutputLocation: The location where output from
  307. // diagnostic command can be found.
  308. type DiagnoseClusterOutputLocation struct {
  309. // OutputUri: [Output-only] The Google Cloud Storage URI of the
  310. // diagnostic output. This will be a plain text file with summary of
  311. // collected diagnostics.
  312. OutputUri string `json:"outputUri,omitempty"`
  313. // ForceSendFields is a list of field names (e.g. "OutputUri") to
  314. // unconditionally include in API requests. By default, fields with
  315. // empty values are omitted from API requests. However, any non-pointer,
  316. // non-interface field appearing in ForceSendFields will be sent to the
  317. // server regardless of whether the field is empty or not. This may be
  318. // used to include empty fields in Patch requests.
  319. ForceSendFields []string `json:"-"`
  320. }
  321. func (s *DiagnoseClusterOutputLocation) MarshalJSON() ([]byte, error) {
  322. type noMethod DiagnoseClusterOutputLocation
  323. raw := noMethod(*s)
  324. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  325. }
  326. // DiskConfiguration: Specifies the configuration of disk options for a
  327. // group of VM instances.
  328. type DiskConfiguration struct {
  329. // BootDiskSizeGb: [Optional] Size in GB of the boot disk (default is
  330. // 500GB).
  331. BootDiskSizeGb int64 `json:"bootDiskSizeGb,omitempty"`
  332. // NumLocalSsds: [Optional] Number of attached SSDs, from 0 to 4
  333. // (default is 0). If SSDs are not attached, the boot disk is used to
  334. // store runtime logs, and HDFS data. If one or more SSDs are attached,
  335. // this runtime bulk data is spread across them, and the boot disk
  336. // contains only basic configuration and installed binaries.
  337. NumLocalSsds int64 `json:"numLocalSsds,omitempty"`
  338. // ForceSendFields is a list of field names (e.g. "BootDiskSizeGb") to
  339. // unconditionally include in API requests. By default, fields with
  340. // empty values are omitted from API requests. However, any non-pointer,
  341. // non-interface field appearing in ForceSendFields will be sent to the
  342. // server regardless of whether the field is empty or not. This may be
  343. // used to include empty fields in Patch requests.
  344. ForceSendFields []string `json:"-"`
  345. }
  346. func (s *DiskConfiguration) MarshalJSON() ([]byte, error) {
  347. type noMethod DiskConfiguration
  348. raw := noMethod(*s)
  349. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  350. }
  351. // Empty: A generic empty message that you can re-use to avoid defining
  352. // duplicated empty messages in your APIs. A typical example is to use
  353. // it as the request or the response type of an API method. For
  354. // instance: service Foo { rpc Bar(google.protobuf.Empty) returns
  355. // (google.protobuf.Empty); } The JSON representation for `Empty` is
  356. // empty JSON object `{}`.
  357. type Empty struct {
  358. // ServerResponse contains the HTTP response code and headers from the
  359. // server.
  360. googleapi.ServerResponse `json:"-"`
  361. }
  362. // GceClusterConfiguration: Common configuration settings for resources
  363. // of Google Compute Engine cluster instances, applicable to all
  364. // instances in the cluster.
  365. type GceClusterConfiguration struct {
  366. // NetworkUri: The Google Compute Engine network to be used for machine
  367. // communications. Inbound SSH connections are necessary to complete
  368. // cluster configuration. Example
  369. // "compute.googleapis.com/projects/[project_id]
  370. // /zones/us-east1-a/default".
  371. NetworkUri string `json:"networkUri,omitempty"`
  372. // ServiceAccountScopes: The service account scopes included in Google
  373. // Compute Engine instances. Must include devstorage.full_control to
  374. // enable the Google Cloud Storage connector. Example
  375. // "auth.googleapis.com/compute" and
  376. // "auth.googleapis.com/devstorage.full_control".
  377. ServiceAccountScopes []string `json:"serviceAccountScopes,omitempty"`
  378. // ZoneUri: [Required] The zone where the Google Compute Engine cluster
  379. // will be located. Example:
  380. // "compute.googleapis.com/projects/[project_id] /zones/us-east1-a".
  381. ZoneUri string `json:"zoneUri,omitempty"`
  382. // ForceSendFields is a list of field names (e.g. "NetworkUri") to
  383. // unconditionally include in API requests. By default, fields with
  384. // empty values are omitted from API requests. However, any non-pointer,
  385. // non-interface field appearing in ForceSendFields will be sent to the
  386. // server regardless of whether the field is empty or not. This may be
  387. // used to include empty fields in Patch requests.
  388. ForceSendFields []string `json:"-"`
  389. }
  390. func (s *GceClusterConfiguration) MarshalJSON() ([]byte, error) {
  391. type noMethod GceClusterConfiguration
  392. raw := noMethod(*s)
  393. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  394. }
  395. // GceConfiguration: [Deprecated] Common configuration settings for
  396. // resources of Google Compute Engine cluster instances, applicable to
  397. // all instances in the cluster.
  398. type GceConfiguration struct {
  399. // ImageUri: [Deprecated] The Google Compute Engine image resource used
  400. // for cluster instances. Example:
  401. // "compute.googleapis.com/projects/debian-cloud
  402. // /global/images/backports-debian-7-wheezy-v20140904".
  403. ImageUri string `json:"imageUri,omitempty"`
  404. // MachineTypeUri: [Deprecated] The Google Compute Engine machine type
  405. // used for cluster instances. Example:
  406. // "compute.googleapis.com/projects/[project_id]
  407. // /zones/us-east1-a/machineTypes/n1-standard-2".
  408. MachineTypeUri string `json:"machineTypeUri,omitempty"`
  409. // NetworkUri: [Deprecated] The Google Compute Engine network to be used
  410. // for machine communications. Inbound SSH connections are necessary to
  411. // complete cluster configuration. Example
  412. // "compute.googleapis.com/projects/[project_id]
  413. // /zones/us-east1-a/default".
  414. NetworkUri string `json:"networkUri,omitempty"`
  415. // ServiceAccountScopes: [Deprecated] The service account scopes
  416. // included in Google Compute Engine instances. Must include
  417. // devstorage.full_control to enable the Google Cloud Storage connector.
  418. // Example "auth.googleapis.com/compute" and
  419. // "auth.googleapis.com/devstorage.full_control".
  420. ServiceAccountScopes []string `json:"serviceAccountScopes,omitempty"`
  421. // ZoneUri: [Deprecated] The zone where the Google Compute Engine
  422. // cluster will be located. Example:
  423. // "compute.googleapis.com/projects/[project_id] /zones/us-east1-a".
  424. ZoneUri string `json:"zoneUri,omitempty"`
  425. // ForceSendFields is a list of field names (e.g. "ImageUri") to
  426. // unconditionally include in API requests. By default, fields with
  427. // empty values are omitted from API requests. However, any non-pointer,
  428. // non-interface field appearing in ForceSendFields will be sent to the
  429. // server regardless of whether the field is empty or not. This may be
  430. // used to include empty fields in Patch requests.
  431. ForceSendFields []string `json:"-"`
  432. }
  433. func (s *GceConfiguration) MarshalJSON() ([]byte, error) {
  434. type noMethod GceConfiguration
  435. raw := noMethod(*s)
  436. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  437. }
  438. // HadoopJob: A Cloud Dataproc job for running Hadoop MapReduce jobs on
  439. // YARN.
  440. type HadoopJob struct {
  441. // ArchiveUris: [Optional] HCFS URIs of archives to be extracted in the
  442. // working directory of Hadoop drivers and tasks. Supported file types:
  443. // .jar, .tar, .tar.gz, .tgz, or .zip.
  444. ArchiveUris []string `json:"archiveUris,omitempty"`
  445. // Args: [Optional] The arguments to pass to the driver. Do not include
  446. // arguments, such as -libjars or -Dfoo=bar, that can be set as job
  447. // properties, since a collision may occur that causes an incorrect job
  448. // submission.
  449. Args []string `json:"args,omitempty"`
  450. // FileUris: [Optional] HCFS URIs of files to be copied to the working
  451. // directory of Hadoop drivers and distributed tasks. Useful for naively
  452. // parallel tasks.
  453. FileUris []string `json:"fileUris,omitempty"`
  454. // JarFileUris: [Optional] Jar file URIs to add to the CLASSPATHs of the
  455. // Hadoop driver and tasks.
  456. JarFileUris []string `json:"jarFileUris,omitempty"`
  457. // LoggingConfiguration: [Optional] The runtime log configuration for
  458. // job execution.
  459. LoggingConfiguration *LoggingConfiguration `json:"loggingConfiguration,omitempty"`
  460. // MainClass: The name of the driver's main class. The jar file
  461. // containing the class must be in the default CLASSPATH or specified in
  462. // jar_file_uris.
  463. MainClass string `json:"mainClass,omitempty"`
  464. // MainJarFileUri: The Hadoop Compatible Filesystem (HCFS) URI of the
  465. // jar file containing the main class. Examples:
  466. // gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar
  467. // hdfs:/tmp/test-samples/custom-wordcount.jar
  468. // file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar
  469. MainJarFileUri string `json:"mainJarFileUri,omitempty"`
  470. // Properties: [Optional] A mapping of property names to values, used to
  471. // configure Hadoop. Properties that conflict with values set by the
  472. // Cloud Dataproc API may be overwritten. Can include properties set in
  473. // /etc/hadoop/conf/*-site and classes in user code.
  474. Properties map[string]string `json:"properties,omitempty"`
  475. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  476. // unconditionally include in API requests. By default, fields with
  477. // empty values are omitted from API requests. However, any non-pointer,
  478. // non-interface field appearing in ForceSendFields will be sent to the
  479. // server regardless of whether the field is empty or not. This may be
  480. // used to include empty fields in Patch requests.
  481. ForceSendFields []string `json:"-"`
  482. }
  483. func (s *HadoopJob) MarshalJSON() ([]byte, error) {
  484. type noMethod HadoopJob
  485. raw := noMethod(*s)
  486. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  487. }
  488. // HiveJob: A Cloud Dataproc job for running Hive queries on YARN.
  489. type HiveJob struct {
  490. // ContinueOnFailure: [Optional] Whether to continue executing queries
  491. // if a query fails. The default value is false. Setting to true can be
  492. // useful when executing independent parallel queries.
  493. ContinueOnFailure bool `json:"continueOnFailure,omitempty"`
  494. // JarFileUris: [Optional] HCFS URIs of jar files to add to the
  495. // CLASSPATH of the Hive server and Hadoop MapReduce (MR) tasks. Can
  496. // contain Hive SerDes and UDFs.
  497. JarFileUris []string `json:"jarFileUris,omitempty"`
  498. // Properties: [Optional] A mapping of property names and values, used
  499. // to configure Hive. Properties that conflict with values set by the
  500. // Cloud Dataproc API may be overwritten. Can include properties set in
  501. // /etc/hadoop/conf/*-site.xml, /etc/hive/conf/hive-site.xml, and
  502. // classes in user code.
  503. Properties map[string]string `json:"properties,omitempty"`
  504. // QueryFileUri: The HCFS URI of the script that contains Hive queries.
  505. QueryFileUri string `json:"queryFileUri,omitempty"`
  506. // QueryList: A list of queries.
  507. QueryList *QueryList `json:"queryList,omitempty"`
  508. // ScriptVariables: [Optional] Mapping of query variable names to values
  509. // (equivalent to the Hive command: 'SET name="value";').
  510. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  511. // ForceSendFields is a list of field names (e.g. "ContinueOnFailure")
  512. // to unconditionally include in API requests. By default, fields with
  513. // empty values are omitted from API requests. However, any non-pointer,
  514. // non-interface field appearing in ForceSendFields will be sent to the
  515. // server regardless of whether the field is empty or not. This may be
  516. // used to include empty fields in Patch requests.
  517. ForceSendFields []string `json:"-"`
  518. }
  519. func (s *HiveJob) MarshalJSON() ([]byte, error) {
  520. type noMethod HiveJob
  521. raw := noMethod(*s)
  522. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  523. }
  524. // InstanceGroupConfiguration: The configuration settings for Google
  525. // Compute Engine resources in an instance group, such as a master or
  526. // worker group.
  527. type InstanceGroupConfiguration struct {
  528. // DiskConfiguration: Disk option configuration settings.
  529. DiskConfiguration *DiskConfiguration `json:"diskConfiguration,omitempty"`
  530. // ImageUri: [Output-only] The Google Compute Engine image resource used
  531. // for cluster instances. Inferred from
  532. // SoftwareConfiguration.image_version. Example:
  533. // "compute.googleapis.com/projects/debian-cloud
  534. // /global/images/backports-debian-7-wheezy-v20140904".
  535. ImageUri string `json:"imageUri,omitempty"`
  536. // InstanceNames: The list of instance names. Dataproc derives the names
  537. // from cluster_name, num_instances, and the instance group if not set
  538. // by user (recommended practice is to let Dataproc derive the name).
  539. InstanceNames []string `json:"instanceNames,omitempty"`
  540. // IsPreemptible: Specifies that this instance group contains
  541. // Preemptible Instances.
  542. IsPreemptible bool `json:"isPreemptible,omitempty"`
  543. // MachineTypeUri: The Google Compute Engine machine type used for
  544. // cluster instances. Example:
  545. // "compute.googleapis.com/projects/[project_id]
  546. // /zones/us-east1-a/machineTypes/n1-standard-2".
  547. MachineTypeUri string `json:"machineTypeUri,omitempty"`
  548. // ManagedGroupConfiguration: [Output-only] The configuration for Google
  549. // Compute Engine Instance Group Manager that manages this group. This
  550. // is only used for preemptible instance groups.
  551. ManagedGroupConfiguration *ManagedGroupConfiguration `json:"managedGroupConfiguration,omitempty"`
  552. // NumInstances: The number of VM instances in the instance group. For
  553. // master instance groups, must be set to 1.
  554. NumInstances int64 `json:"numInstances,omitempty"`
  555. // ForceSendFields is a list of field names (e.g. "DiskConfiguration")
  556. // to unconditionally include in API requests. By default, fields with
  557. // empty values are omitted from API requests. However, any non-pointer,
  558. // non-interface field appearing in ForceSendFields will be sent to the
  559. // server regardless of whether the field is empty or not. This may be
  560. // used to include empty fields in Patch requests.
  561. ForceSendFields []string `json:"-"`
  562. }
  563. func (s *InstanceGroupConfiguration) MarshalJSON() ([]byte, error) {
  564. type noMethod InstanceGroupConfiguration
  565. raw := noMethod(*s)
  566. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  567. }
  568. // Job: A Cloud Dataproc job resource.
  569. type Job struct {
  570. // DriverControlFilesUri: [Output-only] If present, the location of
  571. // miscellaneous control files which may be used as part of job setup
  572. // and handling. If not present, control files may be placed in the same
  573. // location as driver_output_uri.
  574. DriverControlFilesUri string `json:"driverControlFilesUri,omitempty"`
  575. // DriverInputResourceUri: [Output-only] A URI pointing to the location
  576. // of the stdin of the job's driver program, only set if the job is
  577. // interactive.
  578. DriverInputResourceUri string `json:"driverInputResourceUri,omitempty"`
  579. // DriverOutputResourceUri: [Output-only] A URI pointing to the location
  580. // of the stdout of the job's driver program.
  581. DriverOutputResourceUri string `json:"driverOutputResourceUri,omitempty"`
  582. // DriverOutputUri: [Output-only] A URI pointing to the location of the
  583. // mixed stdout/stderr of the job's driver program—for example,
  584. // gs://sysbucket123/foo-cluster/jobid-123/driver/output.
  585. DriverOutputUri string `json:"driverOutputUri,omitempty"`
  586. // HadoopJob: Job is a Hadoop job.
  587. HadoopJob *HadoopJob `json:"hadoopJob,omitempty"`
  588. // HiveJob: Job is a Hive job.
  589. HiveJob *HiveJob `json:"hiveJob,omitempty"`
  590. // Interactive: [Optional] If set to true, then the driver's stdin will
  591. // be kept open and driver_input_uri will be set to provide a path at
  592. // which additional input can be sent to the driver.
  593. Interactive bool `json:"interactive,omitempty"`
  594. // PigJob: Job is a Pig job.
  595. PigJob *PigJob `json:"pigJob,omitempty"`
  596. // Placement: [Required] Job information, including how, when, and where
  597. // to run the job.
  598. Placement *JobPlacement `json:"placement,omitempty"`
  599. // PysparkJob: Job is a Pyspark job.
  600. PysparkJob *PySparkJob `json:"pysparkJob,omitempty"`
  601. // Reference: [Optional] The fully-qualified reference to the job, which
  602. // can be used to obtain the equivalent REST path of the job resource.
  603. // If this property is not specified when a job is created, the server
  604. // generates a job_id.
  605. Reference *JobReference `json:"reference,omitempty"`
  606. // SparkJob: Job is a Spark job.
  607. SparkJob *SparkJob `json:"sparkJob,omitempty"`
  608. // SparkSqlJob: Job is a SparkSql job.
  609. SparkSqlJob *SparkSqlJob `json:"sparkSqlJob,omitempty"`
  610. // Status: [Output-only] The job status. Additional application-specific
  611. // status information may be contained in the type_job and
  612. // yarn_applications fields.
  613. Status *JobStatus `json:"status,omitempty"`
  614. // StatusHistory: [Output-only] The previous job status.
  615. StatusHistory []*JobStatus `json:"statusHistory,omitempty"`
  616. // SubmittedBy: [Output-only] The email address of the user submitting
  617. // the job. For jobs submitted on the cluster, the address is
  618. // username@hostname.
  619. SubmittedBy string `json:"submittedBy,omitempty"`
  620. // YarnApplications: [Output-only] The collection of Yarn applications
  621. // spun up by this job.
  622. YarnApplications []*YarnApplication `json:"yarnApplications,omitempty"`
  623. // ServerResponse contains the HTTP response code and headers from the
  624. // server.
  625. googleapi.ServerResponse `json:"-"`
  626. // ForceSendFields is a list of field names (e.g.
  627. // "DriverControlFilesUri") to unconditionally include in API requests.
  628. // By default, fields with empty values are omitted from API requests.
  629. // However, any non-pointer, non-interface field appearing in
  630. // ForceSendFields will be sent to the server regardless of whether the
  631. // field is empty or not. This may be used to include empty fields in
  632. // Patch requests.
  633. ForceSendFields []string `json:"-"`
  634. }
  635. func (s *Job) MarshalJSON() ([]byte, error) {
  636. type noMethod Job
  637. raw := noMethod(*s)
  638. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  639. }
  640. // JobPlacement: Cloud Dataproc job configuration.
  641. type JobPlacement struct {
  642. // ClusterName: [Required] The name of the cluster where the job will be
  643. // submitted.
  644. ClusterName string `json:"clusterName,omitempty"`
  645. // ClusterUuid: [Output-only] A cluster UUID generated by the Dataproc
  646. // service when the job is submitted.
  647. ClusterUuid string `json:"clusterUuid,omitempty"`
  648. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  649. // unconditionally include in API requests. By default, fields with
  650. // empty values are omitted from API requests. However, any non-pointer,
  651. // non-interface field appearing in ForceSendFields will be sent to the
  652. // server regardless of whether the field is empty or not. This may be
  653. // used to include empty fields in Patch requests.
  654. ForceSendFields []string `json:"-"`
  655. }
  656. func (s *JobPlacement) MarshalJSON() ([]byte, error) {
  657. type noMethod JobPlacement
  658. raw := noMethod(*s)
  659. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  660. }
  661. // JobReference: Encapsulates the full scoping used to reference a job.
  662. type JobReference struct {
  663. // JobId: [Required] The job ID, which must be unique within the
  664. // project. The job ID is generated by the server upon job submission or
  665. // provided by the user as a means to perform retries without creating
  666. // duplicate jobs. The ID must contain only letters (a-z, A-Z), numbers
  667. // (0-9), underscores (_), or dashes (-). The maximum length is 512
  668. // characters.
  669. JobId string `json:"jobId,omitempty"`
  670. // ProjectId: [Required] The ID of the Google Cloud Platform project
  671. // that the job belongs to.
  672. ProjectId string `json:"projectId,omitempty"`
  673. // ForceSendFields is a list of field names (e.g. "JobId") to
  674. // unconditionally include in API requests. By default, fields with
  675. // empty values are omitted from API requests. However, any non-pointer,
  676. // non-interface field appearing in ForceSendFields will be sent to the
  677. // server regardless of whether the field is empty or not. This may be
  678. // used to include empty fields in Patch requests.
  679. ForceSendFields []string `json:"-"`
  680. }
  681. func (s *JobReference) MarshalJSON() ([]byte, error) {
  682. type noMethod JobReference
  683. raw := noMethod(*s)
  684. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  685. }
  686. // JobStatus: Cloud Dataproc job status.
  687. type JobStatus struct {
  688. // Details: [Optional] Job state details, such as an error description
  689. // if the state is ERROR.
  690. Details string `json:"details,omitempty"`
  691. // EndTime: The time when the job completed.
  692. EndTime string `json:"endTime,omitempty"`
  693. // InsertTime: The time of the job request.
  694. InsertTime string `json:"insertTime,omitempty"`
  695. // StartTime: The time when the server started the job.
  696. StartTime string `json:"startTime,omitempty"`
  697. // State: [Required] A state message specifying the overall job state.
  698. //
  699. // Possible values:
  700. // "STATE_UNSPECIFIED"
  701. // "PENDING"
  702. // "SETUP_DONE"
  703. // "RUNNING"
  704. // "CANCEL_PENDING"
  705. // "CANCEL_STARTED"
  706. // "CANCELLED"
  707. // "DONE"
  708. // "ERROR"
  709. State string `json:"state,omitempty"`
  710. // StateStartTime: [Output-only] The time when this state was entered.
  711. StateStartTime string `json:"stateStartTime,omitempty"`
  712. // ForceSendFields is a list of field names (e.g. "Details") to
  713. // unconditionally include in API requests. By default, fields with
  714. // empty values are omitted from API requests. However, any non-pointer,
  715. // non-interface field appearing in ForceSendFields will be sent to the
  716. // server regardless of whether the field is empty or not. This may be
  717. // used to include empty fields in Patch requests.
  718. ForceSendFields []string `json:"-"`
  719. }
  720. func (s *JobStatus) MarshalJSON() ([]byte, error) {
  721. type noMethod JobStatus
  722. raw := noMethod(*s)
  723. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  724. }
  725. // LeaseTasksRequest: A request to lease tasks for execution by an
  726. // agent.
  727. type LeaseTasksRequest struct {
  728. // AgentId: The agent's id.
  729. AgentId string `json:"agentId,omitempty"`
  730. // CurrentAgentTime: The current timestamp at the worker.
  731. CurrentAgentTime string `json:"currentAgentTime,omitempty"`
  732. // RequestedLeaseDuration: The requested initial lease period.
  733. RequestedLeaseDuration string `json:"requestedLeaseDuration,omitempty"`
  734. // ForceSendFields is a list of field names (e.g. "AgentId") to
  735. // unconditionally include in API requests. By default, fields with
  736. // empty values are omitted from API requests. However, any non-pointer,
  737. // non-interface field appearing in ForceSendFields will be sent to the
  738. // server regardless of whether the field is empty or not. This may be
  739. // used to include empty fields in Patch requests.
  740. ForceSendFields []string `json:"-"`
  741. }
  742. func (s *LeaseTasksRequest) MarshalJSON() ([]byte, error) {
  743. type noMethod LeaseTasksRequest
  744. raw := noMethod(*s)
  745. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  746. }
  747. // LeaseTasksResponse: A Response for task leasing.
  748. type LeaseTasksResponse struct {
  749. // LeaseExpirationTime: The worker-local lease expiration time.
  750. LeaseExpirationTime string `json:"leaseExpirationTime,omitempty"`
  751. // ReportStatusInterval: The interval at which status should be
  752. // reported.
  753. ReportStatusInterval string `json:"reportStatusInterval,omitempty"`
  754. // Tasks: A list of tasks that have been leased.
  755. Tasks []*Task `json:"tasks,omitempty"`
  756. // ServerResponse contains the HTTP response code and headers from the
  757. // server.
  758. googleapi.ServerResponse `json:"-"`
  759. // ForceSendFields is a list of field names (e.g. "LeaseExpirationTime")
  760. // to unconditionally include in API requests. By default, fields with
  761. // empty values are omitted from API requests. However, any non-pointer,
  762. // non-interface field appearing in ForceSendFields will be sent to the
  763. // server regardless of whether the field is empty or not. This may be
  764. // used to include empty fields in Patch requests.
  765. ForceSendFields []string `json:"-"`
  766. }
  767. func (s *LeaseTasksResponse) MarshalJSON() ([]byte, error) {
  768. type noMethod LeaseTasksResponse
  769. raw := noMethod(*s)
  770. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  771. }
  772. // ListAgentsResponse: Response to ListAgents
  773. type ListAgentsResponse struct {
  774. // Agents: A list of agents.
  775. Agents []*Agent `json:"agents,omitempty"`
  776. // NextPageToken: The token to send to ListAgents to acquire any
  777. // following pages. Will be empty for last page.
  778. NextPageToken string `json:"nextPageToken,omitempty"`
  779. // ServerResponse contains the HTTP response code and headers from the
  780. // server.
  781. googleapi.ServerResponse `json:"-"`
  782. // ForceSendFields is a list of field names (e.g. "Agents") to
  783. // unconditionally include in API requests. By default, fields with
  784. // empty values are omitted from API requests. However, any non-pointer,
  785. // non-interface field appearing in ForceSendFields will be sent to the
  786. // server regardless of whether the field is empty or not. This may be
  787. // used to include empty fields in Patch requests.
  788. ForceSendFields []string `json:"-"`
  789. }
  790. func (s *ListAgentsResponse) MarshalJSON() ([]byte, error) {
  791. type noMethod ListAgentsResponse
  792. raw := noMethod(*s)
  793. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  794. }
  795. // ListClustersResponse: The list of all clusters in a project.
  796. type ListClustersResponse struct {
  797. // Clusters: [Output-only] The clusters in the project.
  798. Clusters []*Cluster `json:"clusters,omitempty"`
  799. // NextPageToken: The standard List next-page token.
  800. NextPageToken string `json:"nextPageToken,omitempty"`
  801. // ServerResponse contains the HTTP response code and headers from the
  802. // server.
  803. googleapi.ServerResponse `json:"-"`
  804. // ForceSendFields is a list of field names (e.g. "Clusters") to
  805. // unconditionally include in API requests. By default, fields with
  806. // empty values are omitted from API requests. However, any non-pointer,
  807. // non-interface field appearing in ForceSendFields will be sent to the
  808. // server regardless of whether the field is empty or not. This may be
  809. // used to include empty fields in Patch requests.
  810. ForceSendFields []string `json:"-"`
  811. }
  812. func (s *ListClustersResponse) MarshalJSON() ([]byte, error) {
  813. type noMethod ListClustersResponse
  814. raw := noMethod(*s)
  815. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  816. }
  817. // ListJobsRequest: A request to list jobs in a project.
  818. type ListJobsRequest struct {
  819. // ClusterName: [Optional] If set, the returned jobs list includes only
  820. // jobs that were submitted to the named cluster.
  821. ClusterName string `json:"clusterName,omitempty"`
  822. // JobStateMatcher: [Optional] Specifies enumerated categories of jobs
  823. // to list.
  824. //
  825. // Possible values:
  826. // "ALL"
  827. // "ACTIVE"
  828. // "NON_ACTIVE"
  829. JobStateMatcher string `json:"jobStateMatcher,omitempty"`
  830. // PageSize: [Optional] The number of results to return in each
  831. // response.
  832. PageSize int64 `json:"pageSize,omitempty"`
  833. // PageToken: [Optional] The page token, returned by a previous call, to
  834. // request the next page of results.
  835. PageToken string `json:"pageToken,omitempty"`
  836. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  837. // unconditionally include in API requests. By default, fields with
  838. // empty values are omitted from API requests. However, any non-pointer,
  839. // non-interface field appearing in ForceSendFields will be sent to the
  840. // server regardless of whether the field is empty or not. This may be
  841. // used to include empty fields in Patch requests.
  842. ForceSendFields []string `json:"-"`
  843. }
  844. func (s *ListJobsRequest) MarshalJSON() ([]byte, error) {
  845. type noMethod ListJobsRequest
  846. raw := noMethod(*s)
  847. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  848. }
  849. // ListJobsResponse: A response to a request to list jobs in a project.
  850. type ListJobsResponse struct {
  851. // Jobs: [Output-only] Jobs list.
  852. Jobs []*Job `json:"jobs,omitempty"`
  853. // NextPageToken: [Optional] This token is included in the response if
  854. // there are more results to fetch. To fetch additional results, provide
  855. // this value as the page_token in a subsequent ListJobsRequest.
  856. NextPageToken string `json:"nextPageToken,omitempty"`
  857. // ForceSendFields is a list of field names (e.g. "Jobs") 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. }
  865. func (s *ListJobsResponse) MarshalJSON() ([]byte, error) {
  866. type noMethod ListJobsResponse
  867. raw := noMethod(*s)
  868. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  869. }
  870. // ListOperationsResponse: The response message for
  871. // Operations.ListOperations.
  872. type ListOperationsResponse struct {
  873. // NextPageToken: The standard List next-page token.
  874. NextPageToken string `json:"nextPageToken,omitempty"`
  875. // Operations: A list of operations that match the specified filter in
  876. // the request.
  877. Operations []*Operation `json:"operations,omitempty"`
  878. // ServerResponse contains the HTTP response code and headers from the
  879. // server.
  880. googleapi.ServerResponse `json:"-"`
  881. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  882. // unconditionally include in API requests. By default, fields with
  883. // empty values are omitted from API requests. However, any non-pointer,
  884. // non-interface field appearing in ForceSendFields will be sent to the
  885. // server regardless of whether the field is empty or not. This may be
  886. // used to include empty fields in Patch requests.
  887. ForceSendFields []string `json:"-"`
  888. }
  889. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  890. type noMethod ListOperationsResponse
  891. raw := noMethod(*s)
  892. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  893. }
  894. // LoggingConfiguration: The runtime logging configuration of the job.
  895. type LoggingConfiguration struct {
  896. // DriverLogLevels: The per-package log levels for the driver. This may
  897. // include 'root' package name to configure rootLogger. Examples:
  898. // com.google = FATAL, root = INFO, org.apache = DEBUG
  899. DriverLogLevels map[string]string `json:"driverLogLevels,omitempty"`
  900. // ForceSendFields is a list of field names (e.g. "DriverLogLevels") to
  901. // unconditionally include in API requests. By default, fields with
  902. // empty values are omitted from API requests. However, any non-pointer,
  903. // non-interface field appearing in ForceSendFields will be sent to the
  904. // server regardless of whether the field is empty or not. This may be
  905. // used to include empty fields in Patch requests.
  906. ForceSendFields []string `json:"-"`
  907. }
  908. func (s *LoggingConfiguration) MarshalJSON() ([]byte, error) {
  909. type noMethod LoggingConfiguration
  910. raw := noMethod(*s)
  911. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  912. }
  913. // ManagedGroupConfiguration: Specifies the resources used to actively
  914. // manage an instance group.
  915. type ManagedGroupConfiguration struct {
  916. // InstanceGroupManagerName: [Output-only] The name of Instance Group
  917. // Manager managing this group.
  918. InstanceGroupManagerName string `json:"instanceGroupManagerName,omitempty"`
  919. // InstanceTemplateName: [Output-only] The name of Instance Template
  920. // used for Managed Instance Group.
  921. InstanceTemplateName string `json:"instanceTemplateName,omitempty"`
  922. // ForceSendFields is a list of field names (e.g.
  923. // "InstanceGroupManagerName") to unconditionally include in API
  924. // requests. By default, fields with empty values are omitted from API
  925. // requests. However, any non-pointer, non-interface field appearing in
  926. // ForceSendFields will be sent to the server regardless of whether the
  927. // field is empty or not. This may be used to include empty fields in
  928. // Patch requests.
  929. ForceSendFields []string `json:"-"`
  930. }
  931. func (s *ManagedGroupConfiguration) MarshalJSON() ([]byte, error) {
  932. type noMethod ManagedGroupConfiguration
  933. raw := noMethod(*s)
  934. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  935. }
  936. // NodeInitializationAction: Specifies an executable to run on a fully
  937. // configured node and a timeout period for executable completion.
  938. type NodeInitializationAction struct {
  939. // ExecutableFile: [Required] Google Cloud Storage URI of executable
  940. // file.
  941. ExecutableFile string `json:"executableFile,omitempty"`
  942. // ExecutionTimeout: [Optional] Amount of time executable has to
  943. // complete. Default is 10 minutes. Cluster creation fails with an
  944. // explanatory error message (the name of the executable that caused the
  945. // error and the exceeded timeout period) if the executable is not
  946. // completed at end of the timeout period.
  947. ExecutionTimeout string `json:"executionTimeout,omitempty"`
  948. // ForceSendFields is a list of field names (e.g. "ExecutableFile") to
  949. // unconditionally include in API requests. By default, fields with
  950. // empty values are omitted from API requests. However, any non-pointer,
  951. // non-interface field appearing in ForceSendFields will be sent to the
  952. // server regardless of whether the field is empty or not. This may be
  953. // used to include empty fields in Patch requests.
  954. ForceSendFields []string `json:"-"`
  955. }
  956. func (s *NodeInitializationAction) MarshalJSON() ([]byte, error) {
  957. type noMethod NodeInitializationAction
  958. raw := noMethod(*s)
  959. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  960. }
  961. // Operation: An asynchronous operation in a project that runs over a
  962. // given cluster. Used to track the progress of a user request that is
  963. // running asynchronously. Examples include creating a cluster, updating
  964. // a cluster, and deleting a cluster.
  965. type Operation struct {
  966. // Done: Indicates if the operation is done. If true, the operation is
  967. // complete and the `result` is available. If false, the operation is
  968. // still in progress.
  969. Done bool `json:"done,omitempty"`
  970. // Error: The error result of the operation in case of failure.
  971. Error *Status `json:"error,omitempty"`
  972. // Metadata: Service-specific metadata associated with the operation.
  973. Metadata OperationMetadata `json:"metadata,omitempty"`
  974. // Name: The name of the operation resource, in the format
  975. // projects/[project_id]/operations/[operation_id]
  976. Name string `json:"name,omitempty"`
  977. // Response: The operation response. If the called method returns no
  978. // data on success, the response is `google.protobuf.Empty`. If the
  979. // called method is `Get`,`Create` or `Update`, the response is the
  980. // resource. For all other methods, the response type is a concatenation
  981. // of the method name and "Response". For example, if the called method
  982. // is `TakeSnapshot()`, the response type is `TakeSnapshotResponse`.
  983. Response OperationResponse `json:"response,omitempty"`
  984. // ServerResponse contains the HTTP response code and headers from the
  985. // server.
  986. googleapi.ServerResponse `json:"-"`
  987. // ForceSendFields is a list of field names (e.g. "Done") to
  988. // unconditionally include in API requests. By default, fields with
  989. // empty values are omitted from API requests. However, any non-pointer,
  990. // non-interface field appearing in ForceSendFields will be sent to the
  991. // server regardless of whether the field is empty or not. This may be
  992. // used to include empty fields in Patch requests.
  993. ForceSendFields []string `json:"-"`
  994. }
  995. func (s *Operation) MarshalJSON() ([]byte, error) {
  996. type noMethod Operation
  997. raw := noMethod(*s)
  998. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  999. }
  1000. type OperationMetadata interface{}
  1001. type OperationResponse interface{}
  1002. // OperationMetadata1: Metadata describing the operation.
  1003. type OperationMetadata1 struct {
  1004. // ClusterName: Name of the cluster for the operation.
  1005. ClusterName string `json:"clusterName,omitempty"`
  1006. // ClusterUuid: Cluster UUId for the operation.
  1007. ClusterUuid string `json:"clusterUuid,omitempty"`
  1008. // Details: A message containing any operation metadata details.
  1009. Details string `json:"details,omitempty"`
  1010. // EndTime: The time that the operation completed.
  1011. EndTime string `json:"endTime,omitempty"`
  1012. // InnerState: A message containing the detailed operation state.
  1013. InnerState string `json:"innerState,omitempty"`
  1014. // InsertTime: The time that the operation was requested.
  1015. InsertTime string `json:"insertTime,omitempty"`
  1016. // StartTime: The time that the operation was started by the server.
  1017. StartTime string `json:"startTime,omitempty"`
  1018. // State: A message containing the operation state.
  1019. //
  1020. // Possible values:
  1021. // "UNKNOWN"
  1022. // "PENDING"
  1023. // "RUNNING"
  1024. // "DONE"
  1025. State string `json:"state,omitempty"`
  1026. // Status: [Output-only] Current operation status.
  1027. Status *OperationStatus `json:"status,omitempty"`
  1028. // StatusHistory: [Output-only] Previous operation status.
  1029. StatusHistory []*OperationStatus `json:"statusHistory,omitempty"`
  1030. // ForceSendFields is a list of field names (e.g. "ClusterName") 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. }
  1038. func (s *OperationMetadata1) MarshalJSON() ([]byte, error) {
  1039. type noMethod OperationMetadata1
  1040. raw := noMethod(*s)
  1041. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1042. }
  1043. // OperationStatus: The status of the operation.
  1044. type OperationStatus struct {
  1045. // Details: A message containing any operation metadata details.
  1046. Details string `json:"details,omitempty"`
  1047. // InnerState: A message containing the detailed operation state.
  1048. InnerState string `json:"innerState,omitempty"`
  1049. // State: A message containing the operation state.
  1050. //
  1051. // Possible values:
  1052. // "UNKNOWN"
  1053. // "PENDING"
  1054. // "RUNNING"
  1055. // "DONE"
  1056. State string `json:"state,omitempty"`
  1057. // StateStartTime: The time this state was entered.
  1058. StateStartTime string `json:"stateStartTime,omitempty"`
  1059. // ForceSendFields is a list of field names (e.g. "Details") to
  1060. // unconditionally include in API requests. By default, fields with
  1061. // empty values are omitted from API requests. However, any non-pointer,
  1062. // non-interface field appearing in ForceSendFields will be sent to the
  1063. // server regardless of whether the field is empty or not. This may be
  1064. // used to include empty fields in Patch requests.
  1065. ForceSendFields []string `json:"-"`
  1066. }
  1067. func (s *OperationStatus) MarshalJSON() ([]byte, error) {
  1068. type noMethod OperationStatus
  1069. raw := noMethod(*s)
  1070. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1071. }
  1072. // PigJob: A Cloud Dataproc job for running Pig queries on YARN.
  1073. type PigJob struct {
  1074. // ContinueOnFailure: [Optional] Whether to continue executing queries
  1075. // if a query fails. The default value is false. Setting to true can be
  1076. // useful when executing independent parallel queries.
  1077. ContinueOnFailure bool `json:"continueOnFailure,omitempty"`
  1078. // JarFileUris: [Optional] HCFS URIs of jar files to add to the
  1079. // CLASSPATH of the Pig Client and Hadoop MapReduce (MR) tasks. Can
  1080. // contain Pig UDFs.
  1081. JarFileUris []string `json:"jarFileUris,omitempty"`
  1082. // LoggingConfiguration: [Optional] The runtime log configuration for
  1083. // job execution.
  1084. LoggingConfiguration *LoggingConfiguration `json:"loggingConfiguration,omitempty"`
  1085. // Properties: [Optional] A mapping of property names to values, used to
  1086. // configure Pig. Properties that conflict with values set by the Cloud
  1087. // Dataproc API may be overwritten. Can include properties set in
  1088. // /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and
  1089. // classes in user code.
  1090. Properties map[string]string `json:"properties,omitempty"`
  1091. // QueryFileUri: The HCFS URI of the script that contains the Pig
  1092. // queries.
  1093. QueryFileUri string `json:"queryFileUri,omitempty"`
  1094. // QueryList: A list of queries.
  1095. QueryList *QueryList `json:"queryList,omitempty"`
  1096. // ScriptVariables: [Optional] Mapping of query variable names to values
  1097. // (equivalent to the Pig command: "name=[value]").
  1098. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  1099. // ForceSendFields is a list of field names (e.g. "ContinueOnFailure")
  1100. // to unconditionally include in API requests. By default, fields with
  1101. // empty values are omitted from API requests. However, any non-pointer,
  1102. // non-interface field appearing in ForceSendFields will be sent to the
  1103. // server regardless of whether the field is empty or not. This may be
  1104. // used to include empty fields in Patch requests.
  1105. ForceSendFields []string `json:"-"`
  1106. }
  1107. func (s *PigJob) MarshalJSON() ([]byte, error) {
  1108. type noMethod PigJob
  1109. raw := noMethod(*s)
  1110. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1111. }
  1112. // PySparkJob: A Cloud Dataproc job for running PySpark applications on
  1113. // YARN.
  1114. type PySparkJob struct {
  1115. // ArchiveUris: [Optional] HCFS URIs of archives to be extracted in the
  1116. // working directory of .jar, .tar, .tar.gz, .tgz, and .zip.
  1117. ArchiveUris []string `json:"archiveUris,omitempty"`
  1118. // Args: [Optional] The arguments to pass to the driver. Do not include
  1119. // arguments, such as --conf, that can be set as job properties, since a
  1120. // collision may occur that causes an incorrect job submission.
  1121. Args []string `json:"args,omitempty"`
  1122. // FileUris: [Optional] HCFS URIs of files to be copied to the working
  1123. // directory of Python drivers and distributed tasks. Useful for naively
  1124. // parallel tasks.
  1125. FileUris []string `json:"fileUris,omitempty"`
  1126. // JarFileUris: [Optional] HCFS URIs of jar files to add to the
  1127. // CLASSPATHs of the Python driver and tasks.
  1128. JarFileUris []string `json:"jarFileUris,omitempty"`
  1129. // LoggingConfiguration: [Optional] The runtime log configuration for
  1130. // job execution.
  1131. LoggingConfiguration *LoggingConfiguration `json:"loggingConfiguration,omitempty"`
  1132. // MainPythonFileUri: [Required] The Hadoop Compatible Filesystem (HCFS)
  1133. // URI of the main Python file to use as the driver. Must be a .py file.
  1134. MainPythonFileUri string `json:"mainPythonFileUri,omitempty"`
  1135. // Properties: [Optional] A mapping of property names to values, used to
  1136. // configure PySpark. Properties that conflict with values set by the
  1137. // Cloud Dataproc API may be overwritten. Can include properties set in
  1138. // /etc/spark/conf/spark-defaults.conf and classes in user code.
  1139. Properties map[string]string `json:"properties,omitempty"`
  1140. // PythonFileUris: [Optional] HCFS file URIs of Python files to pass to
  1141. // the PySpark framework. Supported file types: .py, .egg, and .zip.
  1142. PythonFileUris []string `json:"pythonFileUris,omitempty"`
  1143. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  1144. // unconditionally include in API requests. By default, fields with
  1145. // empty values are omitted from API requests. However, any non-pointer,
  1146. // non-interface field appearing in ForceSendFields will be sent to the
  1147. // server regardless of whether the field is empty or not. This may be
  1148. // used to include empty fields in Patch requests.
  1149. ForceSendFields []string `json:"-"`
  1150. }
  1151. func (s *PySparkJob) MarshalJSON() ([]byte, error) {
  1152. type noMethod PySparkJob
  1153. raw := noMethod(*s)
  1154. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1155. }
  1156. // QueryList: A list of queries to run on a cluster.
  1157. type QueryList struct {
  1158. // Queries: [Required] The queries to execute. You do not need to
  1159. // terminate a query with a semicolon. Multiple queries can be specified
  1160. // in one string by separating each with a semicolon. Here is an example
  1161. // of an Cloud Dataproc API snippet that uses a QueryList to specify a
  1162. // HiveJob: "hiveJob": { "queryList": { "queries": [ "query1", "query2",
  1163. // "query3;query4", ] } }
  1164. Queries []string `json:"queries,omitempty"`
  1165. // ForceSendFields is a list of field names (e.g. "Queries") to
  1166. // unconditionally include in API requests. By default, fields with
  1167. // empty values are omitted from API requests. However, any non-pointer,
  1168. // non-interface field appearing in ForceSendFields will be sent to the
  1169. // server regardless of whether the field is empty or not. This may be
  1170. // used to include empty fields in Patch requests.
  1171. ForceSendFields []string `json:"-"`
  1172. }
  1173. func (s *QueryList) MarshalJSON() ([]byte, error) {
  1174. type noMethod QueryList
  1175. raw := noMethod(*s)
  1176. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1177. }
  1178. // ReportTaskStatusRequest: A request to report task status, which may
  1179. // result in the corresponding lease being extended.
  1180. type ReportTaskStatusRequest struct {
  1181. // AgentId: The id of the agent reporting task status.
  1182. AgentId string `json:"agentId,omitempty"`
  1183. // CurrentWorkerTime: The current timestamp at the worker.
  1184. CurrentWorkerTime string `json:"currentWorkerTime,omitempty"`
  1185. // Status: Status for a single task.
  1186. Status *TaskStatus `json:"status,omitempty"`
  1187. // ForceSendFields is a list of field names (e.g. "AgentId") to
  1188. // unconditionally include in API requests. By default, fields with
  1189. // empty values are omitted from API requests. However, any non-pointer,
  1190. // non-interface field appearing in ForceSendFields will be sent to the
  1191. // server regardless of whether the field is empty or not. This may be
  1192. // used to include empty fields in Patch requests.
  1193. ForceSendFields []string `json:"-"`
  1194. }
  1195. func (s *ReportTaskStatusRequest) MarshalJSON() ([]byte, error) {
  1196. type noMethod ReportTaskStatusRequest
  1197. raw := noMethod(*s)
  1198. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1199. }
  1200. // ReportTaskStatusResponse: A response to a task status report.
  1201. type ReportTaskStatusResponse struct {
  1202. // LeaseExpirationTime: New task lease expiration timestamp in
  1203. // worker-local time.
  1204. LeaseExpirationTime string `json:"leaseExpirationTime,omitempty"`
  1205. // ReportStatusInterval: The interval at which status should be
  1206. // reported.
  1207. ReportStatusInterval string `json:"reportStatusInterval,omitempty"`
  1208. // ServerResponse contains the HTTP response code and headers from the
  1209. // server.
  1210. googleapi.ServerResponse `json:"-"`
  1211. // ForceSendFields is a list of field names (e.g. "LeaseExpirationTime")
  1212. // to unconditionally include in API requests. By default, fields with
  1213. // empty values are omitted from API requests. However, any non-pointer,
  1214. // non-interface field appearing in ForceSendFields will be sent to the
  1215. // server regardless of whether the field is empty or not. This may be
  1216. // used to include empty fields in Patch requests.
  1217. ForceSendFields []string `json:"-"`
  1218. }
  1219. func (s *ReportTaskStatusResponse) MarshalJSON() ([]byte, error) {
  1220. type noMethod ReportTaskStatusResponse
  1221. raw := noMethod(*s)
  1222. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1223. }
  1224. // SoftwareConfiguration: Specifies the selection and configuration of
  1225. // software inside the cluster.
  1226. type SoftwareConfiguration struct {
  1227. // ImageVersion: [Optional] The version of software inside the cluster.
  1228. // It must match the regular expression [0-9]+\.[0-9]+. If unspecified
  1229. // it will default to latest version.
  1230. ImageVersion string `json:"imageVersion,omitempty"`
  1231. // ForceSendFields is a list of field names (e.g. "ImageVersion") to
  1232. // unconditionally include in API requests. By default, fields with
  1233. // empty values are omitted from API requests. However, any non-pointer,
  1234. // non-interface field appearing in ForceSendFields will be sent to the
  1235. // server regardless of whether the field is empty or not. This may be
  1236. // used to include empty fields in Patch requests.
  1237. ForceSendFields []string `json:"-"`
  1238. }
  1239. func (s *SoftwareConfiguration) MarshalJSON() ([]byte, error) {
  1240. type noMethod SoftwareConfiguration
  1241. raw := noMethod(*s)
  1242. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1243. }
  1244. // SparkJob: A Cloud Dataproc job for running Spark applications on
  1245. // YARN.
  1246. type SparkJob struct {
  1247. // ArchiveUris: [Optional] HCFS URIs of archives to be extracted in the
  1248. // working directory of Spark drivers and tasks. Supported file types:
  1249. // .jar, .tar, .tar.gz, .tgz, and .zip.
  1250. ArchiveUris []string `json:"archiveUris,omitempty"`
  1251. // Args: [Optional] The arguments to pass to the driver. Do not include
  1252. // arguments, such as --conf, that can be set as job properties, since a
  1253. // collision may occur that causes an incorrect job submission.
  1254. Args []string `json:"args,omitempty"`
  1255. // FileUris: [Optional] HCFS URIs of files to be copied to the working
  1256. // directory of Spark drivers and distributed tasks. Useful for naively
  1257. // parallel tasks.
  1258. FileUris []string `json:"fileUris,omitempty"`
  1259. // JarFileUris: [Optional] HCFS URIs of jar files to add to the
  1260. // CLASSPATHs of the Spark driver and tasks.
  1261. JarFileUris []string `json:"jarFileUris,omitempty"`
  1262. // LoggingConfiguration: [Optional] The runtime log configuration for
  1263. // job execution.
  1264. LoggingConfiguration *LoggingConfiguration `json:"loggingConfiguration,omitempty"`
  1265. // MainClass: The name of the driver's main class. The jar file that
  1266. // contains the class must be in the default CLASSPATH or specified in
  1267. // jar_file_uris.
  1268. MainClass string `json:"mainClass,omitempty"`
  1269. // MainJarFileUri: The Hadoop Compatible Filesystem (HCFS) URI of the
  1270. // jar file that contains the main class.
  1271. MainJarFileUri string `json:"mainJarFileUri,omitempty"`
  1272. // Properties: [Optional] A mapping of property names to values, used to
  1273. // configure Spark. Properties that conflict with values set by the
  1274. // Cloud Dataproc API may be overwritten. Can include properties set in
  1275. // /etc/spark/conf/spark-defaults.conf and classes in user code.
  1276. Properties map[string]string `json:"properties,omitempty"`
  1277. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  1278. // unconditionally include in API requests. By default, fields with
  1279. // empty values are omitted from API requests. However, any non-pointer,
  1280. // non-interface field appearing in ForceSendFields will be sent to the
  1281. // server regardless of whether the field is empty or not. This may be
  1282. // used to include empty fields in Patch requests.
  1283. ForceSendFields []string `json:"-"`
  1284. }
  1285. func (s *SparkJob) MarshalJSON() ([]byte, error) {
  1286. type noMethod SparkJob
  1287. raw := noMethod(*s)
  1288. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1289. }
  1290. // SparkSqlJob: A Cloud Dataproc job for running Spark SQL queries.
  1291. type SparkSqlJob struct {
  1292. // JarFileUris: [Optional] HCFS URIs of jar files to be added to the
  1293. // Spark CLASSPATH.
  1294. JarFileUris []string `json:"jarFileUris,omitempty"`
  1295. // LoggingConfiguration: [Optional] The runtime log configuration for
  1296. // job execution.
  1297. LoggingConfiguration *LoggingConfiguration `json:"loggingConfiguration,omitempty"`
  1298. // Properties: [Optional] A mapping of property names to values, used to
  1299. // configure Spark SQL's SparkConf. Properties that conflict with values
  1300. // set by the Cloud Dataproc API may be overwritten.
  1301. Properties map[string]string `json:"properties,omitempty"`
  1302. // QueryFileUri: The HCFS URI of the script that contains SQL queries.
  1303. QueryFileUri string `json:"queryFileUri,omitempty"`
  1304. // QueryList: A list of queries.
  1305. QueryList *QueryList `json:"queryList,omitempty"`
  1306. // ScriptVariables: [Optional] Mapping of query variable names to values
  1307. // (equivalent to the Spark SQL command: SET name="value";).
  1308. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  1309. // ForceSendFields is a list of field names (e.g. "JarFileUris") to
  1310. // unconditionally include in API requests. By default, fields with
  1311. // empty values are omitted from API requests. However, any non-pointer,
  1312. // non-interface field appearing in ForceSendFields will be sent to the
  1313. // server regardless of whether the field is empty or not. This may be
  1314. // used to include empty fields in Patch requests.
  1315. ForceSendFields []string `json:"-"`
  1316. }
  1317. func (s *SparkSqlJob) MarshalJSON() ([]byte, error) {
  1318. type noMethod SparkSqlJob
  1319. raw := noMethod(*s)
  1320. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1321. }
  1322. // Status: The `Status` type defines a logical error model that is
  1323. // suitable for different programming environments, including REST APIs
  1324. // and RPC APIs. It is used by [gRPC](https://github.com/grpc). The
  1325. // error model is designed to be: - Simple to use and understand for
  1326. // most users - Flexible enough to meet unexpected needs # Overview The
  1327. // `Status` message contains three pieces of data: error code, error
  1328. // message, and error details. The error code should be an enum value of
  1329. // google.rpc.Code, but it may accept additional error codes if needed.
  1330. // The error message should be a developer-facing English message that
  1331. // helps developers *understand* and *resolve* the error. If a localized
  1332. // user-facing error message is needed, put the localized message in the
  1333. // error details or localize it in the client. The optional error
  1334. // details may contain arbitrary information about the error. There is a
  1335. // predefined set of error detail types in the package `google.rpc`
  1336. // which can be used for common error conditions. # Language mapping The
  1337. // `Status` message is the logical representation of the error model,
  1338. // but it is not necessarily the actual wire format. When the `Status`
  1339. // message is exposed in different client libraries and different wire
  1340. // protocols, it can be mapped differently. For example, it will likely
  1341. // be mapped to some exceptions in Java, but more likely mapped to some
  1342. // error codes in C. # Other uses The error model and the `Status`
  1343. // message can be used in a variety of environments, either with or
  1344. // without APIs, to provide a consistent developer experience across
  1345. // different environments. Example uses of this error model include: -
  1346. // Partial errors. If a service needs to return partial errors to the
  1347. // client, it may embed the `Status` in the normal response to indicate
  1348. // the partial errors. - Workflow errors. A typical workflow has
  1349. // multiple steps. Each step may have a `Status` message for error
  1350. // reporting purpose. - Batch operations. If a client uses batch request
  1351. // and batch response, the `Status` message should be used directly
  1352. // inside batch response, one for each error sub-response. -
  1353. // Asynchronous operations. If an API call embeds asynchronous operation
  1354. // results in its response, the status of those operations should be
  1355. // represented directly using the `Status` message. - Logging. If some
  1356. // API errors are stored in logs, the message `Status` could be used
  1357. // directly after any stripping needed for security/privacy reasons.
  1358. type Status struct {
  1359. // Code: The status code, which should be an enum value of
  1360. // google.rpc.Code.
  1361. Code int64 `json:"code,omitempty"`
  1362. // Details: A list of messages that carry the error details. There will
  1363. // be a common set of message types for APIs to use.
  1364. Details []StatusDetails `json:"details,omitempty"`
  1365. // Message: A developer-facing error message, which should be in
  1366. // English. Any user-facing error message should be localized and sent
  1367. // in the google.rpc.Status.details field, or localized by the client.
  1368. Message string `json:"message,omitempty"`
  1369. // ForceSendFields is a list of field names (e.g. "Code") to
  1370. // unconditionally include in API requests. By default, fields with
  1371. // empty values are omitted from API requests. However, any non-pointer,
  1372. // non-interface field appearing in ForceSendFields will be sent to the
  1373. // server regardless of whether the field is empty or not. This may be
  1374. // used to include empty fields in Patch requests.
  1375. ForceSendFields []string `json:"-"`
  1376. }
  1377. func (s *Status) MarshalJSON() ([]byte, error) {
  1378. type noMethod Status
  1379. raw := noMethod(*s)
  1380. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1381. }
  1382. type StatusDetails interface{}
  1383. // SubmitJobRequest: A job submission request.
  1384. type SubmitJobRequest struct {
  1385. // Job: [Required] The job resource.
  1386. Job *Job `json:"job,omitempty"`
  1387. // ForceSendFields is a list of field names (e.g. "Job") to
  1388. // unconditionally include in API requests. By default, fields with
  1389. // empty values are omitted from API requests. However, any non-pointer,
  1390. // non-interface field appearing in ForceSendFields will be sent to the
  1391. // server regardless of whether the field is empty or not. This may be
  1392. // used to include empty fields in Patch requests.
  1393. ForceSendFields []string `json:"-"`
  1394. }
  1395. func (s *SubmitJobRequest) MarshalJSON() ([]byte, error) {
  1396. type noMethod SubmitJobRequest
  1397. raw := noMethod(*s)
  1398. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1399. }
  1400. // SystemTaskStatus: Status of cluster configuration task.
  1401. type SystemTaskStatus struct {
  1402. // State: The outcome of reconfiguration.
  1403. //
  1404. // Possible values:
  1405. // "STATE_UNSPECIFIED"
  1406. // "PENDING"
  1407. // "RUNNING"
  1408. // "FINISHED"
  1409. // "FAILED"
  1410. State string `json:"state,omitempty"`
  1411. // ForceSendFields is a list of field names (e.g. "State") to
  1412. // unconditionally include in API requests. By default, fields with
  1413. // empty values are omitted from API requests. However, any non-pointer,
  1414. // non-interface field appearing in ForceSendFields will be sent to the
  1415. // server regardless of whether the field is empty or not. This may be
  1416. // used to include empty fields in Patch requests.
  1417. ForceSendFields []string `json:"-"`
  1418. }
  1419. func (s *SystemTaskStatus) MarshalJSON() ([]byte, error) {
  1420. type noMethod SystemTaskStatus
  1421. raw := noMethod(*s)
  1422. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1423. }
  1424. // Task: A single Task for agent execution. A task in Cloud Dataproc is
  1425. // a unit of work originating with the Cloud Dataproc service and
  1426. // intended for execution on a Cloud Dataproc agent. The most
  1427. // straightforward example of a Task in Cloud Dataproc is one
  1428. // corresponding to an end-user originated Job. This task is then
  1429. // allocated to an available agent for execution. Other examples of
  1430. // Cloud Dataproc Tasks could include executing system-maintenance
  1431. // scripts, periodic agent upgrades, etc. Using the example of a Task
  1432. // corresponding to a Job, the flow through Cloud Dataproc will appear
  1433. // as: - The end-user submits a Job to Cloud Dataproc for execution. -
  1434. // The Cloud Dataproc service determines the best Cluster to execute the
  1435. // Job on and creates a Task for the job. - An agent polls Cloud
  1436. // Dataproc for outstanding Tasks via the LeaseTasks method and the Task
  1437. // created in step 2 is provided to the agent. - During execution of the
  1438. // Task, the agent updates the Task status via the ReportTaskStatus
  1439. // method. - Upon completion of a Task, the agent will finally
  1440. // ReportTaskStatus with a TaskStatus indicating the status of the
  1441. // driver application's exit status. - The Cloud Dataproc service
  1442. // updates the status of the user-submitted Job using the Task status
  1443. // reported by the agent.
  1444. type Task struct {
  1445. // Configuration: Configuration for this task.
  1446. Configuration *TaskConfiguration `json:"configuration,omitempty"`
  1447. // Status: The status of a task.
  1448. Status *TaskStatus `json:"status,omitempty"`
  1449. // TaskId: System defined task id.
  1450. TaskId string `json:"taskId,omitempty"`
  1451. // ForceSendFields is a list of field names (e.g. "Configuration") to
  1452. // unconditionally include in API requests. By default, fields with
  1453. // empty values are omitted from API requests. However, any non-pointer,
  1454. // non-interface field appearing in ForceSendFields will be sent to the
  1455. // server regardless of whether the field is empty or not. This may be
  1456. // used to include empty fields in Patch requests.
  1457. ForceSendFields []string `json:"-"`
  1458. }
  1459. func (s *Task) MarshalJSON() ([]byte, error) {
  1460. type noMethod Task
  1461. raw := noMethod(*s)
  1462. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1463. }
  1464. // TaskClusterConfiguration: A system task corresponding to a request
  1465. // for Master node to update configuration based on provided values.
  1466. type TaskClusterConfiguration struct {
  1467. // AddMembers: New nodes to register with cluster.
  1468. AddMembers []string `json:"addMembers,omitempty"`
  1469. // RemoveMembers: Existing nodes to decommission.
  1470. RemoveMembers []string `json:"removeMembers,omitempty"`
  1471. // Type: Type of configuration change.
  1472. //
  1473. // Possible values:
  1474. // "TYPE_UNSPECIFIED"
  1475. // "TYPE_CLUSTER_MEMBERSHIP_CHANGE"
  1476. Type string `json:"type,omitempty"`
  1477. // ForceSendFields is a list of field names (e.g. "AddMembers") to
  1478. // unconditionally include in API requests. By default, fields with
  1479. // empty values are omitted from API requests. However, any non-pointer,
  1480. // non-interface field appearing in ForceSendFields will be sent to the
  1481. // server regardless of whether the field is empty or not. This may be
  1482. // used to include empty fields in Patch requests.
  1483. ForceSendFields []string `json:"-"`
  1484. }
  1485. func (s *TaskClusterConfiguration) MarshalJSON() ([]byte, error) {
  1486. type noMethod TaskClusterConfiguration
  1487. raw := noMethod(*s)
  1488. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1489. }
  1490. // TaskConfiguration: Configuration for a Dataproc Task.
  1491. type TaskConfiguration struct {
  1492. // ClusterConfiguration: Cluster reconfiguration task.
  1493. ClusterConfiguration *TaskClusterConfiguration `json:"clusterConfiguration,omitempty"`
  1494. // JobConfiguration: Configuration of a Job-based task.
  1495. JobConfiguration *TaskJobConfiguration `json:"jobConfiguration,omitempty"`
  1496. // MaintenanceCommand: Execute cluster maintenance command.
  1497. MaintenanceCommand *TaskMaintenanceCommand `json:"maintenanceCommand,omitempty"`
  1498. // ForceSendFields is a list of field names (e.g.
  1499. // "ClusterConfiguration") to unconditionally include in API requests.
  1500. // By default, fields with empty values are omitted from API requests.
  1501. // However, any non-pointer, non-interface field appearing in
  1502. // ForceSendFields will be sent to the server regardless of whether the
  1503. // field is empty or not. This may be used to include empty fields in
  1504. // Patch requests.
  1505. ForceSendFields []string `json:"-"`
  1506. }
  1507. func (s *TaskConfiguration) MarshalJSON() ([]byte, error) {
  1508. type noMethod TaskConfiguration
  1509. raw := noMethod(*s)
  1510. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1511. }
  1512. // TaskJobConfiguration: A task corresponding to a single job execution
  1513. // request.
  1514. type TaskJobConfiguration struct {
  1515. // ArchiveUris: Required archives for the driver program or distributed
  1516. // program. Used by Hadoop, Spark, and PySpark jobs.
  1517. ArchiveUris []string `json:"archiveUris,omitempty"`
  1518. // Args: Arguments for the driver program. Used by Hadoop, Spark, and
  1519. // PySpark jobs.
  1520. Args []string `json:"args,omitempty"`
  1521. // ContinueOnFailure: True to continue processing pig or hive queries if
  1522. // an earlier query fails.
  1523. ContinueOnFailure bool `json:"continueOnFailure,omitempty"`
  1524. // DriverControlFilesUri: [Output-only] If present, the location of
  1525. // miscellaneous control files which may be used as part of job setup
  1526. // and handling. If not present, control files may be placed in the same
  1527. // location as driver_output_uri.
  1528. DriverControlFilesUri string `json:"driverControlFilesUri,omitempty"`
  1529. // DriverInputUri: [Output-only] A URI pointing to the location of the
  1530. // stdin of the job's driver program, only set if the job is
  1531. // interactive.
  1532. DriverInputUri string `json:"driverInputUri,omitempty"`
  1533. // DriverOutputUri: Output URI for driver output.
  1534. DriverOutputUri string `json:"driverOutputUri,omitempty"`
  1535. // FileUris: Required files for the driver program or distributed
  1536. // program. Used by Hadoop, Spark, and PySpark jobs.
  1537. FileUris []string `json:"fileUris,omitempty"`
  1538. // Interactive: [Optional] If set to true, then the driver's stdin will
  1539. // be kept open and driver_input_uri will be set to provide a path at
  1540. // which additional input can be sent to the driver.
  1541. Interactive bool `json:"interactive,omitempty"`
  1542. // JarFileUris: JAR files that are required by the job.
  1543. JarFileUris []string `json:"jarFileUris,omitempty"`
  1544. // LoggingConfiguration: Logging configuration for the job.
  1545. LoggingConfiguration *TaskLoggingConfiguration `json:"loggingConfiguration,omitempty"`
  1546. // MainClass: A class name that is contained either in core Hadoop or
  1547. // Spark libraries or within a JAR specified within jar_file_uris.
  1548. MainClass string `json:"mainClass,omitempty"`
  1549. // MainJarFileUri: A JAR containing the main driver and containing a
  1550. // METADATA entry for a main class contained within the jar.
  1551. MainJarFileUri string `json:"mainJarFileUri,omitempty"`
  1552. // MainPythonFileUri: The main Python file for a PySpark application.
  1553. MainPythonFileUri string `json:"mainPythonFileUri,omitempty"`
  1554. // Properties: Properties for the submitted job.
  1555. Properties map[string]string `json:"properties,omitempty"`
  1556. // PythonFileUris: URIs of files required by the PySpark application
  1557. PythonFileUris []string `json:"pythonFileUris,omitempty"`
  1558. // QueryFileUri: A URI of a file containing queries
  1559. QueryFileUri string `json:"queryFileUri,omitempty"`
  1560. // QueryList: A list of queries specified within the API.
  1561. QueryList *TaskQueryList `json:"queryList,omitempty"`
  1562. // ScriptVariables: Variables to be substituted in Pig and Hive scripts.
  1563. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  1564. // SubmittedBy: The user that the job should be attributed to in Hadoop
  1565. // as a posix-style username. If the user is not a member of the
  1566. // system's user-database, the task will be started as a system account.
  1567. SubmittedBy string `json:"submittedBy,omitempty"`
  1568. // Type: The type of the job.
  1569. //
  1570. // Possible values:
  1571. // "TYPE_UNSPECIFIED"
  1572. // "HADOOP"
  1573. // "SPARK"
  1574. // "PYSPARK"
  1575. // "HIVE"
  1576. // "PIG"
  1577. // "SPARK_SQL"
  1578. Type string `json:"type,omitempty"`
  1579. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  1580. // unconditionally include in API requests. By default, fields with
  1581. // empty values are omitted from API requests. However, any non-pointer,
  1582. // non-interface field appearing in ForceSendFields will be sent to the
  1583. // server regardless of whether the field is empty or not. This may be
  1584. // used to include empty fields in Patch requests.
  1585. ForceSendFields []string `json:"-"`
  1586. }
  1587. func (s *TaskJobConfiguration) MarshalJSON() ([]byte, error) {
  1588. type noMethod TaskJobConfiguration
  1589. raw := noMethod(*s)
  1590. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1591. }
  1592. // TaskJobStatus: Status of a single job-based task.
  1593. type TaskJobStatus struct {
  1594. // DriverExitCode: If the driver has exited, its exit code.
  1595. DriverExitCode int64 `json:"driverExitCode,omitempty"`
  1596. // DriverState: The state of the driver.
  1597. //
  1598. // Possible values:
  1599. // "DRIVER_STATE_UNSPECIFIED"
  1600. // "PENDING"
  1601. // "RUNNING"
  1602. // "KILL_PENDING"
  1603. // "KILLED"
  1604. // "FINISHED"
  1605. // "FAILED"
  1606. DriverState string `json:"driverState,omitempty"`
  1607. // YarnApplications: A list of YARN applications that have been launched
  1608. // for this task.
  1609. YarnApplications []*TaskYarnApplication `json:"yarnApplications,omitempty"`
  1610. // ForceSendFields is a list of field names (e.g. "DriverExitCode") to
  1611. // unconditionally include in API requests. By default, fields with
  1612. // empty values are omitted from API requests. However, any non-pointer,
  1613. // non-interface field appearing in ForceSendFields will be sent to the
  1614. // server regardless of whether the field is empty or not. This may be
  1615. // used to include empty fields in Patch requests.
  1616. ForceSendFields []string `json:"-"`
  1617. }
  1618. func (s *TaskJobStatus) MarshalJSON() ([]byte, error) {
  1619. type noMethod TaskJobStatus
  1620. raw := noMethod(*s)
  1621. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1622. }
  1623. // TaskLoggingConfiguration: Logging configuration for the task.
  1624. type TaskLoggingConfiguration struct {
  1625. // LogLevels: Map of logger name to log4j log level.
  1626. LogLevels map[string]string `json:"logLevels,omitempty"`
  1627. // ForceSendFields is a list of field names (e.g. "LogLevels") to
  1628. // unconditionally include in API requests. By default, fields with
  1629. // empty values are omitted from API requests. However, any non-pointer,
  1630. // non-interface field appearing in ForceSendFields will be sent to the
  1631. // server regardless of whether the field is empty or not. This may be
  1632. // used to include empty fields in Patch requests.
  1633. ForceSendFields []string `json:"-"`
  1634. }
  1635. func (s *TaskLoggingConfiguration) MarshalJSON() ([]byte, error) {
  1636. type noMethod TaskLoggingConfiguration
  1637. raw := noMethod(*s)
  1638. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1639. }
  1640. // TaskMaintenanceCommand: A system task corresponding to a request to
  1641. // run a maintenance command on targeted agent.
  1642. type TaskMaintenanceCommand struct {
  1643. // Args: Arguments to pass to the script.
  1644. Args []string `json:"args,omitempty"`
  1645. // Environment: The environment variables.
  1646. Environment map[string]string `json:"environment,omitempty"`
  1647. // GcsUri: The executable is stored on GCS.
  1648. GcsUri string `json:"gcsUri,omitempty"`
  1649. // LocalPath: The executable is a file on agent.
  1650. LocalPath string `json:"localPath,omitempty"`
  1651. // ScriptOutputUri: The GCS URI where executable output will be stored.
  1652. ScriptOutputUri string `json:"scriptOutputUri,omitempty"`
  1653. // ForceSendFields is a list of field names (e.g. "Args") to
  1654. // unconditionally include in API requests. By default, fields with
  1655. // empty values are omitted from API requests. However, any non-pointer,
  1656. // non-interface field appearing in ForceSendFields will be sent to the
  1657. // server regardless of whether the field is empty or not. This may be
  1658. // used to include empty fields in Patch requests.
  1659. ForceSendFields []string `json:"-"`
  1660. }
  1661. func (s *TaskMaintenanceCommand) MarshalJSON() ([]byte, error) {
  1662. type noMethod TaskMaintenanceCommand
  1663. raw := noMethod(*s)
  1664. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1665. }
  1666. // TaskQueryList: A list of queries to execute as part of the task.
  1667. type TaskQueryList struct {
  1668. // Queries: The queries to execute. The format of the queries is
  1669. // task-type dependent, but in each case each query should be executed
  1670. // within its own invocation of the interpreter for that task type.
  1671. Queries []string `json:"queries,omitempty"`
  1672. // ForceSendFields is a list of field names (e.g. "Queries") to
  1673. // unconditionally include in API requests. By default, fields with
  1674. // empty values are omitted from API requests. However, any non-pointer,
  1675. // non-interface field appearing in ForceSendFields will be sent to the
  1676. // server regardless of whether the field is empty or not. This may be
  1677. // used to include empty fields in Patch requests.
  1678. ForceSendFields []string `json:"-"`
  1679. }
  1680. func (s *TaskQueryList) MarshalJSON() ([]byte, error) {
  1681. type noMethod TaskQueryList
  1682. raw := noMethod(*s)
  1683. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1684. }
  1685. // TaskStatus: Status for a single Task.
  1686. type TaskStatus struct {
  1687. // JobStatus: The status of the Job.
  1688. JobStatus *TaskJobStatus `json:"jobStatus,omitempty"`
  1689. // SystemTaskStatus: The status of the SystemTask.
  1690. SystemTaskStatus *SystemTaskStatus `json:"systemTaskStatus,omitempty"`
  1691. // ForceSendFields is a list of field names (e.g. "JobStatus") 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. }
  1699. func (s *TaskStatus) MarshalJSON() ([]byte, error) {
  1700. type noMethod TaskStatus
  1701. raw := noMethod(*s)
  1702. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1703. }
  1704. // TaskYarnApplication: YARN applications that have been associated with
  1705. // a task.
  1706. type TaskYarnApplication struct {
  1707. // Id: YARN application id.
  1708. Id int64 `json:"id,omitempty"`
  1709. // Name: YARN application name.
  1710. Name string `json:"name,omitempty"`
  1711. // Progress: The progress of the YARN application.
  1712. Progress float64 `json:"progress,omitempty"`
  1713. // State: The state of the YARN application.
  1714. //
  1715. // Possible values:
  1716. // "STATE_UNSPECIFIED"
  1717. // "NEW"
  1718. // "NEW_SAVING"
  1719. // "SUBMITTED"
  1720. // "ACCEPTED"
  1721. // "RUNNING"
  1722. // "FINISHED"
  1723. // "FAILED"
  1724. // "KILLED"
  1725. State string `json:"state,omitempty"`
  1726. // TrackingUrl: The tracking URL for the YARN application. This URL may
  1727. // or may not be accessible from outside the cluster.
  1728. TrackingUrl string `json:"trackingUrl,omitempty"`
  1729. // ForceSendFields is a list of field names (e.g. "Id") to
  1730. // unconditionally include in API requests. By default, fields with
  1731. // empty values are omitted from API requests. However, any non-pointer,
  1732. // non-interface field appearing in ForceSendFields will be sent to the
  1733. // server regardless of whether the field is empty or not. This may be
  1734. // used to include empty fields in Patch requests.
  1735. ForceSendFields []string `json:"-"`
  1736. }
  1737. func (s *TaskYarnApplication) MarshalJSON() ([]byte, error) {
  1738. type noMethod TaskYarnApplication
  1739. raw := noMethod(*s)
  1740. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1741. }
  1742. // YarnApplication: A YARN application created by a job. Application
  1743. // information is a subset of
  1744. // org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto.
  1745. type YarnApplication struct {
  1746. // Name: [Required] The application name.
  1747. Name string `json:"name,omitempty"`
  1748. // Progress: [Required] The numerical progress of the application, from
  1749. // 1 to 100.
  1750. Progress float64 `json:"progress,omitempty"`
  1751. // State: [Required] The application state.
  1752. //
  1753. // Possible values:
  1754. // "STATE_UNSPECIFIED"
  1755. // "NEW"
  1756. // "NEW_SAVING"
  1757. // "SUBMITTED"
  1758. // "ACCEPTED"
  1759. // "RUNNING"
  1760. // "FINISHED"
  1761. // "FAILED"
  1762. // "KILLED"
  1763. State string `json:"state,omitempty"`
  1764. // TrackingUrl: [Optional] The HTTP URL of the ApplicationMaster,
  1765. // HistoryServer, or TimelineServer that provides application-specific
  1766. // information. The URL uses the internal hostname, and requires a proxy
  1767. // server for resolution and, possibly, access.
  1768. TrackingUrl string `json:"trackingUrl,omitempty"`
  1769. // ForceSendFields is a list of field names (e.g. "Name") to
  1770. // unconditionally include in API requests. By default, fields with
  1771. // empty values are omitted from API requests. However, any non-pointer,
  1772. // non-interface field appearing in ForceSendFields will be sent to the
  1773. // server regardless of whether the field is empty or not. This may be
  1774. // used to include empty fields in Patch requests.
  1775. ForceSendFields []string `json:"-"`
  1776. }
  1777. func (s *YarnApplication) MarshalJSON() ([]byte, error) {
  1778. type noMethod YarnApplication
  1779. raw := noMethod(*s)
  1780. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1781. }
  1782. // method id "dataproc.operations.cancel":
  1783. type OperationsCancelCall struct {
  1784. s *Service
  1785. name string
  1786. canceloperationrequest *CancelOperationRequest
  1787. urlParams_ gensupport.URLParams
  1788. ctx_ context.Context
  1789. }
  1790. // Cancel: Starts asynchronous cancellation on a long-running operation.
  1791. // The server makes a best effort to cancel the operation, but success
  1792. // is not guaranteed. If the server doesn't support this method, it
  1793. // returns `google.rpc.Code.UNIMPLEMENTED`. Clients may use
  1794. // [Operations.GetOperation] or other methods to check whether the
  1795. // cancellation succeeded or the operation completed despite
  1796. // cancellation.
  1797. func (r *OperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OperationsCancelCall {
  1798. c := &OperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1799. c.name = name
  1800. c.canceloperationrequest = canceloperationrequest
  1801. return c
  1802. }
  1803. // Fields allows partial responses to be retrieved. See
  1804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1805. // for more information.
  1806. func (c *OperationsCancelCall) Fields(s ...googleapi.Field) *OperationsCancelCall {
  1807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1808. return c
  1809. }
  1810. // Context sets the context to be used in this call's Do method. Any
  1811. // pending HTTP request will be aborted if the provided context is
  1812. // canceled.
  1813. func (c *OperationsCancelCall) Context(ctx context.Context) *OperationsCancelCall {
  1814. c.ctx_ = ctx
  1815. return c
  1816. }
  1817. func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  1818. var body io.Reader = nil
  1819. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  1820. if err != nil {
  1821. return nil, err
  1822. }
  1823. ctype := "application/json"
  1824. c.urlParams_.Set("alt", alt)
  1825. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:cancel")
  1826. urls += "?" + c.urlParams_.Encode()
  1827. req, _ := http.NewRequest("POST", urls, body)
  1828. googleapi.Expand(req.URL, map[string]string{
  1829. "name": c.name,
  1830. })
  1831. req.Header.Set("Content-Type", ctype)
  1832. req.Header.Set("User-Agent", c.s.userAgent())
  1833. if c.ctx_ != nil {
  1834. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1835. }
  1836. return c.s.client.Do(req)
  1837. }
  1838. // Do executes the "dataproc.operations.cancel" call.
  1839. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  1840. // code is an error. Response headers are in either
  1841. // *Empty.ServerResponse.Header or (if a response was returned at all)
  1842. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1843. // check whether the returned error was because http.StatusNotModified
  1844. // was returned.
  1845. func (c *OperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1846. gensupport.SetOptions(c.urlParams_, opts...)
  1847. res, err := c.doRequest("json")
  1848. if res != nil && res.StatusCode == http.StatusNotModified {
  1849. if res.Body != nil {
  1850. res.Body.Close()
  1851. }
  1852. return nil, &googleapi.Error{
  1853. Code: res.StatusCode,
  1854. Header: res.Header,
  1855. }
  1856. }
  1857. if err != nil {
  1858. return nil, err
  1859. }
  1860. defer googleapi.CloseBody(res)
  1861. if err := googleapi.CheckResponse(res); err != nil {
  1862. return nil, err
  1863. }
  1864. ret := &Empty{
  1865. ServerResponse: googleapi.ServerResponse{
  1866. Header: res.Header,
  1867. HTTPStatusCode: res.StatusCode,
  1868. },
  1869. }
  1870. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1871. return nil, err
  1872. }
  1873. return ret, nil
  1874. // {
  1875. // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients may use [Operations.GetOperation] or other methods to check whether the cancellation succeeded or the operation completed despite cancellation.",
  1876. // "httpMethod": "POST",
  1877. // "id": "dataproc.operations.cancel",
  1878. // "parameterOrder": [
  1879. // "name"
  1880. // ],
  1881. // "parameters": {
  1882. // "name": {
  1883. // "description": "The name of the operation resource to be cancelled.",
  1884. // "location": "path",
  1885. // "pattern": "^operations/.*$",
  1886. // "required": true,
  1887. // "type": "string"
  1888. // }
  1889. // },
  1890. // "path": "v1alpha1/{+name}:cancel",
  1891. // "request": {
  1892. // "$ref": "CancelOperationRequest"
  1893. // },
  1894. // "response": {
  1895. // "$ref": "Empty"
  1896. // },
  1897. // "scopes": [
  1898. // "https://www.googleapis.com/auth/cloud-platform"
  1899. // ]
  1900. // }
  1901. }
  1902. // method id "dataproc.operations.delete":
  1903. type OperationsDeleteCall struct {
  1904. s *Service
  1905. name string
  1906. urlParams_ gensupport.URLParams
  1907. ctx_ context.Context
  1908. }
  1909. // Delete: Deletes a long-running operation. It indicates the client is
  1910. // no longer interested in the operation result. It does not cancel the
  1911. // operation.
  1912. func (r *OperationsService) Delete(name string) *OperationsDeleteCall {
  1913. c := &OperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1914. c.name = name
  1915. return c
  1916. }
  1917. // Fields allows partial responses to be retrieved. See
  1918. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1919. // for more information.
  1920. func (c *OperationsDeleteCall) Fields(s ...googleapi.Field) *OperationsDeleteCall {
  1921. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1922. return c
  1923. }
  1924. // Context sets the context to be used in this call's Do method. Any
  1925. // pending HTTP request will be aborted if the provided context is
  1926. // canceled.
  1927. func (c *OperationsDeleteCall) Context(ctx context.Context) *OperationsDeleteCall {
  1928. c.ctx_ = ctx
  1929. return c
  1930. }
  1931. func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1932. var body io.Reader = nil
  1933. c.urlParams_.Set("alt", alt)
  1934. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  1935. urls += "?" + c.urlParams_.Encode()
  1936. req, _ := http.NewRequest("DELETE", urls, body)
  1937. googleapi.Expand(req.URL, map[string]string{
  1938. "name": c.name,
  1939. })
  1940. req.Header.Set("User-Agent", c.s.userAgent())
  1941. if c.ctx_ != nil {
  1942. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1943. }
  1944. return c.s.client.Do(req)
  1945. }
  1946. // Do executes the "dataproc.operations.delete" call.
  1947. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  1948. // code is an error. Response headers are in either
  1949. // *Empty.ServerResponse.Header or (if a response was returned at all)
  1950. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1951. // check whether the returned error was because http.StatusNotModified
  1952. // was returned.
  1953. func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1954. gensupport.SetOptions(c.urlParams_, opts...)
  1955. res, err := c.doRequest("json")
  1956. if res != nil && res.StatusCode == http.StatusNotModified {
  1957. if res.Body != nil {
  1958. res.Body.Close()
  1959. }
  1960. return nil, &googleapi.Error{
  1961. Code: res.StatusCode,
  1962. Header: res.Header,
  1963. }
  1964. }
  1965. if err != nil {
  1966. return nil, err
  1967. }
  1968. defer googleapi.CloseBody(res)
  1969. if err := googleapi.CheckResponse(res); err != nil {
  1970. return nil, err
  1971. }
  1972. ret := &Empty{
  1973. ServerResponse: googleapi.ServerResponse{
  1974. Header: res.Header,
  1975. HTTPStatusCode: res.StatusCode,
  1976. },
  1977. }
  1978. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1979. return nil, err
  1980. }
  1981. return ret, nil
  1982. // {
  1983. // "description": "Deletes a long-running operation. It indicates the client is no longer interested in the operation result. It does not cancel the operation.",
  1984. // "httpMethod": "DELETE",
  1985. // "id": "dataproc.operations.delete",
  1986. // "parameterOrder": [
  1987. // "name"
  1988. // ],
  1989. // "parameters": {
  1990. // "name": {
  1991. // "description": "The name of the operation resource to be deleted.",
  1992. // "location": "path",
  1993. // "pattern": "^operations/.*$",
  1994. // "required": true,
  1995. // "type": "string"
  1996. // }
  1997. // },
  1998. // "path": "v1alpha1/{+name}",
  1999. // "response": {
  2000. // "$ref": "Empty"
  2001. // },
  2002. // "scopes": [
  2003. // "https://www.googleapis.com/auth/cloud-platform"
  2004. // ]
  2005. // }
  2006. }
  2007. // method id "dataproc.operations.get":
  2008. type OperationsGetCall struct {
  2009. s *Service
  2010. name string
  2011. urlParams_ gensupport.URLParams
  2012. ifNoneMatch_ string
  2013. ctx_ context.Context
  2014. }
  2015. // Get: Gets the latest state of a long-running operation. Clients may
  2016. // use this method to poll the operation result at intervals as
  2017. // recommended by the API service.
  2018. func (r *OperationsService) Get(name string) *OperationsGetCall {
  2019. c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2020. c.name = name
  2021. return c
  2022. }
  2023. // Fields allows partial responses to be retrieved. See
  2024. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2025. // for more information.
  2026. func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
  2027. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2028. return c
  2029. }
  2030. // IfNoneMatch sets the optional parameter which makes the operation
  2031. // fail if the object's ETag matches the given value. This is useful for
  2032. // getting updates only after the object has changed since the last
  2033. // request. Use googleapi.IsNotModified to check whether the response
  2034. // error from Do is the result of In-None-Match.
  2035. func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
  2036. c.ifNoneMatch_ = entityTag
  2037. return c
  2038. }
  2039. // Context sets the context to be used in this call's Do method. Any
  2040. // pending HTTP request will be aborted if the provided context is
  2041. // canceled.
  2042. func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
  2043. c.ctx_ = ctx
  2044. return c
  2045. }
  2046. func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
  2047. var body io.Reader = nil
  2048. c.urlParams_.Set("alt", alt)
  2049. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  2050. urls += "?" + c.urlParams_.Encode()
  2051. req, _ := http.NewRequest("GET", urls, body)
  2052. googleapi.Expand(req.URL, map[string]string{
  2053. "name": c.name,
  2054. })
  2055. req.Header.Set("User-Agent", c.s.userAgent())
  2056. if c.ifNoneMatch_ != "" {
  2057. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2058. }
  2059. if c.ctx_ != nil {
  2060. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2061. }
  2062. return c.s.client.Do(req)
  2063. }
  2064. // Do executes the "dataproc.operations.get" call.
  2065. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2066. // status code is an error. Response headers are in either
  2067. // *Operation.ServerResponse.Header or (if a response was returned at
  2068. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2069. // to check whether the returned error was because
  2070. // http.StatusNotModified was returned.
  2071. func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2072. gensupport.SetOptions(c.urlParams_, opts...)
  2073. res, err := c.doRequest("json")
  2074. if res != nil && res.StatusCode == http.StatusNotModified {
  2075. if res.Body != nil {
  2076. res.Body.Close()
  2077. }
  2078. return nil, &googleapi.Error{
  2079. Code: res.StatusCode,
  2080. Header: res.Header,
  2081. }
  2082. }
  2083. if err != nil {
  2084. return nil, err
  2085. }
  2086. defer googleapi.CloseBody(res)
  2087. if err := googleapi.CheckResponse(res); err != nil {
  2088. return nil, err
  2089. }
  2090. ret := &Operation{
  2091. ServerResponse: googleapi.ServerResponse{
  2092. Header: res.Header,
  2093. HTTPStatusCode: res.StatusCode,
  2094. },
  2095. }
  2096. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2097. return nil, err
  2098. }
  2099. return ret, nil
  2100. // {
  2101. // "description": "Gets the latest state of a long-running operation. Clients may use this method to poll the operation result at intervals as recommended by the API service.",
  2102. // "httpMethod": "GET",
  2103. // "id": "dataproc.operations.get",
  2104. // "parameterOrder": [
  2105. // "name"
  2106. // ],
  2107. // "parameters": {
  2108. // "name": {
  2109. // "description": "The operation resource name.",
  2110. // "location": "path",
  2111. // "pattern": "^operations/.*$",
  2112. // "required": true,
  2113. // "type": "string"
  2114. // }
  2115. // },
  2116. // "path": "v1alpha1/{+name}",
  2117. // "response": {
  2118. // "$ref": "Operation"
  2119. // },
  2120. // "scopes": [
  2121. // "https://www.googleapis.com/auth/cloud-platform"
  2122. // ]
  2123. // }
  2124. }
  2125. // method id "dataproc.operations.list":
  2126. type OperationsListCall struct {
  2127. s *Service
  2128. name string
  2129. urlParams_ gensupport.URLParams
  2130. ifNoneMatch_ string
  2131. ctx_ context.Context
  2132. }
  2133. // List: Lists operations that match the specified filter in the
  2134. // request. If the server doesn't support this method, it returns
  2135. // `google.rpc.Code.UNIMPLEMENTED`.
  2136. func (r *OperationsService) List(name string) *OperationsListCall {
  2137. c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2138. c.name = name
  2139. return c
  2140. }
  2141. // Filter sets the optional parameter "filter": [Required] A JSON object
  2142. // that contains filters for the list operation, in the format
  2143. // {"key1":"value1","key2":"value2", ..., }. Possible keys include
  2144. // project_id, cluster_name, and operation_state_matcher. If project_id
  2145. // is set, requests the list of operations that belong to the specified
  2146. // Google Cloud Platform project ID. This key is required. If
  2147. // cluster_name is set, requests the list of operations that were
  2148. // submitted to the specified cluster name. This key is optional. If
  2149. // operation_state_matcher is set, requests the list of operations that
  2150. // match one of the following status options: ALL, ACTIVE, or
  2151. // NON_ACTIVE.
  2152. func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
  2153. c.urlParams_.Set("filter", filter)
  2154. return c
  2155. }
  2156. // PageSize sets the optional parameter "pageSize": The standard List
  2157. // page size.
  2158. func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall {
  2159. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2160. return c
  2161. }
  2162. // PageToken sets the optional parameter "pageToken": The standard List
  2163. // page token.
  2164. func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
  2165. c.urlParams_.Set("pageToken", pageToken)
  2166. return c
  2167. }
  2168. // Fields allows partial responses to be retrieved. See
  2169. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2170. // for more information.
  2171. func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
  2172. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2173. return c
  2174. }
  2175. // IfNoneMatch sets the optional parameter which makes the operation
  2176. // fail if the object's ETag matches the given value. This is useful for
  2177. // getting updates only after the object has changed since the last
  2178. // request. Use googleapi.IsNotModified to check whether the response
  2179. // error from Do is the result of In-None-Match.
  2180. func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
  2181. c.ifNoneMatch_ = entityTag
  2182. return c
  2183. }
  2184. // Context sets the context to be used in this call's Do method. Any
  2185. // pending HTTP request will be aborted if the provided context is
  2186. // canceled.
  2187. func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
  2188. c.ctx_ = ctx
  2189. return c
  2190. }
  2191. func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
  2192. var body io.Reader = nil
  2193. c.urlParams_.Set("alt", alt)
  2194. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  2195. urls += "?" + c.urlParams_.Encode()
  2196. req, _ := http.NewRequest("GET", urls, body)
  2197. googleapi.Expand(req.URL, map[string]string{
  2198. "name": c.name,
  2199. })
  2200. req.Header.Set("User-Agent", c.s.userAgent())
  2201. if c.ifNoneMatch_ != "" {
  2202. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2203. }
  2204. if c.ctx_ != nil {
  2205. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2206. }
  2207. return c.s.client.Do(req)
  2208. }
  2209. // Do executes the "dataproc.operations.list" call.
  2210. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  2211. // non-2xx status code is an error. Response headers are in either
  2212. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  2213. // returned at all) in error.(*googleapi.Error).Header. Use
  2214. // googleapi.IsNotModified to check whether the returned error was
  2215. // because http.StatusNotModified was returned.
  2216. func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  2217. gensupport.SetOptions(c.urlParams_, opts...)
  2218. res, err := c.doRequest("json")
  2219. if res != nil && res.StatusCode == http.StatusNotModified {
  2220. if res.Body != nil {
  2221. res.Body.Close()
  2222. }
  2223. return nil, &googleapi.Error{
  2224. Code: res.StatusCode,
  2225. Header: res.Header,
  2226. }
  2227. }
  2228. if err != nil {
  2229. return nil, err
  2230. }
  2231. defer googleapi.CloseBody(res)
  2232. if err := googleapi.CheckResponse(res); err != nil {
  2233. return nil, err
  2234. }
  2235. ret := &ListOperationsResponse{
  2236. ServerResponse: googleapi.ServerResponse{
  2237. Header: res.Header,
  2238. HTTPStatusCode: res.StatusCode,
  2239. },
  2240. }
  2241. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2242. return nil, err
  2243. }
  2244. return ret, nil
  2245. // {
  2246. // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.",
  2247. // "httpMethod": "GET",
  2248. // "id": "dataproc.operations.list",
  2249. // "parameterOrder": [
  2250. // "name"
  2251. // ],
  2252. // "parameters": {
  2253. // "filter": {
  2254. // "description": "[Required] A JSON object that contains filters for the list operation, in the format {\"key1\":\"value1\",\"key2\":\"value2\", ..., }. Possible keys include project_id, cluster_name, and operation_state_matcher. If project_id is set, requests the list of operations that belong to the specified Google Cloud Platform project ID. This key is required. If cluster_name is set, requests the list of operations that were submitted to the specified cluster name. This key is optional. If operation_state_matcher is set, requests the list of operations that match one of the following status options: ALL, ACTIVE, or NON_ACTIVE.",
  2255. // "location": "query",
  2256. // "type": "string"
  2257. // },
  2258. // "name": {
  2259. // "description": "The operation collection name.",
  2260. // "location": "path",
  2261. // "pattern": "^operations$",
  2262. // "required": true,
  2263. // "type": "string"
  2264. // },
  2265. // "pageSize": {
  2266. // "description": "The standard List page size.",
  2267. // "format": "int32",
  2268. // "location": "query",
  2269. // "type": "integer"
  2270. // },
  2271. // "pageToken": {
  2272. // "description": "The standard List page token.",
  2273. // "location": "query",
  2274. // "type": "string"
  2275. // }
  2276. // },
  2277. // "path": "v1alpha1/{+name}",
  2278. // "response": {
  2279. // "$ref": "ListOperationsResponse"
  2280. // },
  2281. // "scopes": [
  2282. // "https://www.googleapis.com/auth/cloud-platform"
  2283. // ]
  2284. // }
  2285. }
  2286. // Pages invokes f for each page of results.
  2287. // A non-nil error returned from f will halt the iteration.
  2288. // The provided context supersedes any context provided to the Context method.
  2289. func (c *OperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  2290. c.ctx_ = ctx
  2291. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2292. for {
  2293. x, err := c.Do()
  2294. if err != nil {
  2295. return err
  2296. }
  2297. if err := f(x); err != nil {
  2298. return err
  2299. }
  2300. if x.NextPageToken == "" {
  2301. return nil
  2302. }
  2303. c.PageToken(x.NextPageToken)
  2304. }
  2305. }
  2306. // method id "dataproc.projects.clusters.create":
  2307. type ProjectsClustersCreateCall struct {
  2308. s *Service
  2309. projectId string
  2310. cluster *Cluster
  2311. urlParams_ gensupport.URLParams
  2312. ctx_ context.Context
  2313. }
  2314. // Create: Request to create a cluster in a project.
  2315. func (r *ProjectsClustersService) Create(projectId string, cluster *Cluster) *ProjectsClustersCreateCall {
  2316. c := &ProjectsClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2317. c.projectId = projectId
  2318. c.cluster = cluster
  2319. return c
  2320. }
  2321. // Fields allows partial responses to be retrieved. See
  2322. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2323. // for more information.
  2324. func (c *ProjectsClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsClustersCreateCall {
  2325. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2326. return c
  2327. }
  2328. // Context sets the context to be used in this call's Do method. Any
  2329. // pending HTTP request will be aborted if the provided context is
  2330. // canceled.
  2331. func (c *ProjectsClustersCreateCall) Context(ctx context.Context) *ProjectsClustersCreateCall {
  2332. c.ctx_ = ctx
  2333. return c
  2334. }
  2335. func (c *ProjectsClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  2336. var body io.Reader = nil
  2337. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster)
  2338. if err != nil {
  2339. return nil, err
  2340. }
  2341. ctype := "application/json"
  2342. c.urlParams_.Set("alt", alt)
  2343. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/clusters")
  2344. urls += "?" + c.urlParams_.Encode()
  2345. req, _ := http.NewRequest("POST", urls, body)
  2346. googleapi.Expand(req.URL, map[string]string{
  2347. "projectId": c.projectId,
  2348. })
  2349. req.Header.Set("Content-Type", ctype)
  2350. req.Header.Set("User-Agent", c.s.userAgent())
  2351. if c.ctx_ != nil {
  2352. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2353. }
  2354. return c.s.client.Do(req)
  2355. }
  2356. // Do executes the "dataproc.projects.clusters.create" call.
  2357. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2358. // status code is an error. Response headers are in either
  2359. // *Operation.ServerResponse.Header or (if a response was returned at
  2360. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2361. // to check whether the returned error was because
  2362. // http.StatusNotModified was returned.
  2363. func (c *ProjectsClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2364. gensupport.SetOptions(c.urlParams_, opts...)
  2365. res, err := c.doRequest("json")
  2366. if res != nil && res.StatusCode == http.StatusNotModified {
  2367. if res.Body != nil {
  2368. res.Body.Close()
  2369. }
  2370. return nil, &googleapi.Error{
  2371. Code: res.StatusCode,
  2372. Header: res.Header,
  2373. }
  2374. }
  2375. if err != nil {
  2376. return nil, err
  2377. }
  2378. defer googleapi.CloseBody(res)
  2379. if err := googleapi.CheckResponse(res); err != nil {
  2380. return nil, err
  2381. }
  2382. ret := &Operation{
  2383. ServerResponse: googleapi.ServerResponse{
  2384. Header: res.Header,
  2385. HTTPStatusCode: res.StatusCode,
  2386. },
  2387. }
  2388. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2389. return nil, err
  2390. }
  2391. return ret, nil
  2392. // {
  2393. // "description": "Request to create a cluster in a project.",
  2394. // "httpMethod": "POST",
  2395. // "id": "dataproc.projects.clusters.create",
  2396. // "parameterOrder": [
  2397. // "projectId"
  2398. // ],
  2399. // "parameters": {
  2400. // "projectId": {
  2401. // "description": "[Required] The ID of the Google Cloud Platform project that the cluster belongs to.",
  2402. // "location": "path",
  2403. // "required": true,
  2404. // "type": "string"
  2405. // }
  2406. // },
  2407. // "path": "v1alpha1/projects/{projectId}/clusters",
  2408. // "request": {
  2409. // "$ref": "Cluster"
  2410. // },
  2411. // "response": {
  2412. // "$ref": "Operation"
  2413. // },
  2414. // "scopes": [
  2415. // "https://www.googleapis.com/auth/cloud-platform"
  2416. // ]
  2417. // }
  2418. }
  2419. // method id "dataproc.projects.clusters.delete":
  2420. type ProjectsClustersDeleteCall struct {
  2421. s *Service
  2422. projectId string
  2423. clusterName string
  2424. urlParams_ gensupport.URLParams
  2425. ctx_ context.Context
  2426. }
  2427. // Delete: Request to delete a cluster in a project.
  2428. func (r *ProjectsClustersService) Delete(projectId string, clusterName string) *ProjectsClustersDeleteCall {
  2429. c := &ProjectsClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2430. c.projectId = projectId
  2431. c.clusterName = clusterName
  2432. return c
  2433. }
  2434. // Fields allows partial responses to be retrieved. See
  2435. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2436. // for more information.
  2437. func (c *ProjectsClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsClustersDeleteCall {
  2438. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2439. return c
  2440. }
  2441. // Context sets the context to be used in this call's Do method. Any
  2442. // pending HTTP request will be aborted if the provided context is
  2443. // canceled.
  2444. func (c *ProjectsClustersDeleteCall) Context(ctx context.Context) *ProjectsClustersDeleteCall {
  2445. c.ctx_ = ctx
  2446. return c
  2447. }
  2448. func (c *ProjectsClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  2449. var body io.Reader = nil
  2450. c.urlParams_.Set("alt", alt)
  2451. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/clusters/{clusterName}")
  2452. urls += "?" + c.urlParams_.Encode()
  2453. req, _ := http.NewRequest("DELETE", urls, body)
  2454. googleapi.Expand(req.URL, map[string]string{
  2455. "projectId": c.projectId,
  2456. "clusterName": c.clusterName,
  2457. })
  2458. req.Header.Set("User-Agent", c.s.userAgent())
  2459. if c.ctx_ != nil {
  2460. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2461. }
  2462. return c.s.client.Do(req)
  2463. }
  2464. // Do executes the "dataproc.projects.clusters.delete" call.
  2465. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2466. // status code is an error. Response headers are in either
  2467. // *Operation.ServerResponse.Header or (if a response was returned at
  2468. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2469. // to check whether the returned error was because
  2470. // http.StatusNotModified was returned.
  2471. func (c *ProjectsClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2472. gensupport.SetOptions(c.urlParams_, opts...)
  2473. res, err := c.doRequest("json")
  2474. if res != nil && res.StatusCode == http.StatusNotModified {
  2475. if res.Body != nil {
  2476. res.Body.Close()
  2477. }
  2478. return nil, &googleapi.Error{
  2479. Code: res.StatusCode,
  2480. Header: res.Header,
  2481. }
  2482. }
  2483. if err != nil {
  2484. return nil, err
  2485. }
  2486. defer googleapi.CloseBody(res)
  2487. if err := googleapi.CheckResponse(res); err != nil {
  2488. return nil, err
  2489. }
  2490. ret := &Operation{
  2491. ServerResponse: googleapi.ServerResponse{
  2492. Header: res.Header,
  2493. HTTPStatusCode: res.StatusCode,
  2494. },
  2495. }
  2496. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2497. return nil, err
  2498. }
  2499. return ret, nil
  2500. // {
  2501. // "description": "Request to delete a cluster in a project.",
  2502. // "httpMethod": "DELETE",
  2503. // "id": "dataproc.projects.clusters.delete",
  2504. // "parameterOrder": [
  2505. // "projectId",
  2506. // "clusterName"
  2507. // ],
  2508. // "parameters": {
  2509. // "clusterName": {
  2510. // "description": "[Required] The cluster name.",
  2511. // "location": "path",
  2512. // "required": true,
  2513. // "type": "string"
  2514. // },
  2515. // "projectId": {
  2516. // "description": "[Required] The ID of the Google Cloud Platform project that the cluster belongs to.",
  2517. // "location": "path",
  2518. // "required": true,
  2519. // "type": "string"
  2520. // }
  2521. // },
  2522. // "path": "v1alpha1/projects/{projectId}/clusters/{clusterName}",
  2523. // "response": {
  2524. // "$ref": "Operation"
  2525. // },
  2526. // "scopes": [
  2527. // "https://www.googleapis.com/auth/cloud-platform"
  2528. // ]
  2529. // }
  2530. }
  2531. // method id "dataproc.projects.clusters.get":
  2532. type ProjectsClustersGetCall struct {
  2533. s *Service
  2534. projectId string
  2535. clusterName string
  2536. urlParams_ gensupport.URLParams
  2537. ifNoneMatch_ string
  2538. ctx_ context.Context
  2539. }
  2540. // Get: Request to get the resource representation for a cluster in a
  2541. // project.
  2542. func (r *ProjectsClustersService) Get(projectId string, clusterName string) *ProjectsClustersGetCall {
  2543. c := &ProjectsClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2544. c.projectId = projectId
  2545. c.clusterName = clusterName
  2546. return c
  2547. }
  2548. // Fields allows partial responses to be retrieved. See
  2549. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2550. // for more information.
  2551. func (c *ProjectsClustersGetCall) Fields(s ...googleapi.Field) *ProjectsClustersGetCall {
  2552. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2553. return c
  2554. }
  2555. // IfNoneMatch sets the optional parameter which makes the operation
  2556. // fail if the object's ETag matches the given value. This is useful for
  2557. // getting updates only after the object has changed since the last
  2558. // request. Use googleapi.IsNotModified to check whether the response
  2559. // error from Do is the result of In-None-Match.
  2560. func (c *ProjectsClustersGetCall) IfNoneMatch(entityTag string) *ProjectsClustersGetCall {
  2561. c.ifNoneMatch_ = entityTag
  2562. return c
  2563. }
  2564. // Context sets the context to be used in this call's Do method. Any
  2565. // pending HTTP request will be aborted if the provided context is
  2566. // canceled.
  2567. func (c *ProjectsClustersGetCall) Context(ctx context.Context) *ProjectsClustersGetCall {
  2568. c.ctx_ = ctx
  2569. return c
  2570. }
  2571. func (c *ProjectsClustersGetCall) doRequest(alt string) (*http.Response, error) {
  2572. var body io.Reader = nil
  2573. c.urlParams_.Set("alt", alt)
  2574. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/clusters/{clusterName}")
  2575. urls += "?" + c.urlParams_.Encode()
  2576. req, _ := http.NewRequest("GET", urls, body)
  2577. googleapi.Expand(req.URL, map[string]string{
  2578. "projectId": c.projectId,
  2579. "clusterName": c.clusterName,
  2580. })
  2581. req.Header.Set("User-Agent", c.s.userAgent())
  2582. if c.ifNoneMatch_ != "" {
  2583. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2584. }
  2585. if c.ctx_ != nil {
  2586. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2587. }
  2588. return c.s.client.Do(req)
  2589. }
  2590. // Do executes the "dataproc.projects.clusters.get" call.
  2591. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  2592. // code is an error. Response headers are in either
  2593. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  2594. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2595. // check whether the returned error was because http.StatusNotModified
  2596. // was returned.
  2597. func (c *ProjectsClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  2598. gensupport.SetOptions(c.urlParams_, opts...)
  2599. res, err := c.doRequest("json")
  2600. if res != nil && res.StatusCode == http.StatusNotModified {
  2601. if res.Body != nil {
  2602. res.Body.Close()
  2603. }
  2604. return nil, &googleapi.Error{
  2605. Code: res.StatusCode,
  2606. Header: res.Header,
  2607. }
  2608. }
  2609. if err != nil {
  2610. return nil, err
  2611. }
  2612. defer googleapi.CloseBody(res)
  2613. if err := googleapi.CheckResponse(res); err != nil {
  2614. return nil, err
  2615. }
  2616. ret := &Cluster{
  2617. ServerResponse: googleapi.ServerResponse{
  2618. Header: res.Header,
  2619. HTTPStatusCode: res.StatusCode,
  2620. },
  2621. }
  2622. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2623. return nil, err
  2624. }
  2625. return ret, nil
  2626. // {
  2627. // "description": "Request to get the resource representation for a cluster in a project.",
  2628. // "httpMethod": "GET",
  2629. // "id": "dataproc.projects.clusters.get",
  2630. // "parameterOrder": [
  2631. // "projectId",
  2632. // "clusterName"
  2633. // ],
  2634. // "parameters": {
  2635. // "clusterName": {
  2636. // "description": "[Required] The cluster name.",
  2637. // "location": "path",
  2638. // "required": true,
  2639. // "type": "string"
  2640. // },
  2641. // "projectId": {
  2642. // "description": "[Required] The ID of the Google Cloud Platform project that the cluster belongs to.",
  2643. // "location": "path",
  2644. // "required": true,
  2645. // "type": "string"
  2646. // }
  2647. // },
  2648. // "path": "v1alpha1/projects/{projectId}/clusters/{clusterName}",
  2649. // "response": {
  2650. // "$ref": "Cluster"
  2651. // },
  2652. // "scopes": [
  2653. // "https://www.googleapis.com/auth/cloud-platform"
  2654. // ]
  2655. // }
  2656. }
  2657. // method id "dataproc.projects.clusters.list":
  2658. type ProjectsClustersListCall struct {
  2659. s *Service
  2660. projectId string
  2661. urlParams_ gensupport.URLParams
  2662. ifNoneMatch_ string
  2663. ctx_ context.Context
  2664. }
  2665. // List: Request a list of all clusters in a project.
  2666. func (r *ProjectsClustersService) List(projectId string) *ProjectsClustersListCall {
  2667. c := &ProjectsClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2668. c.projectId = projectId
  2669. return c
  2670. }
  2671. // PageSize sets the optional parameter "pageSize": The standard List
  2672. // page size.
  2673. func (c *ProjectsClustersListCall) PageSize(pageSize int64) *ProjectsClustersListCall {
  2674. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2675. return c
  2676. }
  2677. // PageToken sets the optional parameter "pageToken": The standard List
  2678. // page token.
  2679. func (c *ProjectsClustersListCall) PageToken(pageToken string) *ProjectsClustersListCall {
  2680. c.urlParams_.Set("pageToken", pageToken)
  2681. return c
  2682. }
  2683. // Fields allows partial responses to be retrieved. See
  2684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2685. // for more information.
  2686. func (c *ProjectsClustersListCall) Fields(s ...googleapi.Field) *ProjectsClustersListCall {
  2687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2688. return c
  2689. }
  2690. // IfNoneMatch sets the optional parameter which makes the operation
  2691. // fail if the object's ETag matches the given value. This is useful for
  2692. // getting updates only after the object has changed since the last
  2693. // request. Use googleapi.IsNotModified to check whether the response
  2694. // error from Do is the result of In-None-Match.
  2695. func (c *ProjectsClustersListCall) IfNoneMatch(entityTag string) *ProjectsClustersListCall {
  2696. c.ifNoneMatch_ = entityTag
  2697. return c
  2698. }
  2699. // Context sets the context to be used in this call's Do method. Any
  2700. // pending HTTP request will be aborted if the provided context is
  2701. // canceled.
  2702. func (c *ProjectsClustersListCall) Context(ctx context.Context) *ProjectsClustersListCall {
  2703. c.ctx_ = ctx
  2704. return c
  2705. }
  2706. func (c *ProjectsClustersListCall) doRequest(alt string) (*http.Response, error) {
  2707. var body io.Reader = nil
  2708. c.urlParams_.Set("alt", alt)
  2709. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/clusters")
  2710. urls += "?" + c.urlParams_.Encode()
  2711. req, _ := http.NewRequest("GET", urls, body)
  2712. googleapi.Expand(req.URL, map[string]string{
  2713. "projectId": c.projectId,
  2714. })
  2715. req.Header.Set("User-Agent", c.s.userAgent())
  2716. if c.ifNoneMatch_ != "" {
  2717. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2718. }
  2719. if c.ctx_ != nil {
  2720. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2721. }
  2722. return c.s.client.Do(req)
  2723. }
  2724. // Do executes the "dataproc.projects.clusters.list" call.
  2725. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  2726. // non-2xx status code is an error. Response headers are in either
  2727. // *ListClustersResponse.ServerResponse.Header or (if a response was
  2728. // returned at all) in error.(*googleapi.Error).Header. Use
  2729. // googleapi.IsNotModified to check whether the returned error was
  2730. // because http.StatusNotModified was returned.
  2731. func (c *ProjectsClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  2732. gensupport.SetOptions(c.urlParams_, opts...)
  2733. res, err := c.doRequest("json")
  2734. if res != nil && res.StatusCode == http.StatusNotModified {
  2735. if res.Body != nil {
  2736. res.Body.Close()
  2737. }
  2738. return nil, &googleapi.Error{
  2739. Code: res.StatusCode,
  2740. Header: res.Header,
  2741. }
  2742. }
  2743. if err != nil {
  2744. return nil, err
  2745. }
  2746. defer googleapi.CloseBody(res)
  2747. if err := googleapi.CheckResponse(res); err != nil {
  2748. return nil, err
  2749. }
  2750. ret := &ListClustersResponse{
  2751. ServerResponse: googleapi.ServerResponse{
  2752. Header: res.Header,
  2753. HTTPStatusCode: res.StatusCode,
  2754. },
  2755. }
  2756. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2757. return nil, err
  2758. }
  2759. return ret, nil
  2760. // {
  2761. // "description": "Request a list of all clusters in a project.",
  2762. // "httpMethod": "GET",
  2763. // "id": "dataproc.projects.clusters.list",
  2764. // "parameterOrder": [
  2765. // "projectId"
  2766. // ],
  2767. // "parameters": {
  2768. // "pageSize": {
  2769. // "description": "The standard List page size.",
  2770. // "format": "int32",
  2771. // "location": "query",
  2772. // "type": "integer"
  2773. // },
  2774. // "pageToken": {
  2775. // "description": "The standard List page token.",
  2776. // "location": "query",
  2777. // "type": "string"
  2778. // },
  2779. // "projectId": {
  2780. // "description": "[Required] The ID of the Google Cloud Platform project that the cluster belongs to.",
  2781. // "location": "path",
  2782. // "required": true,
  2783. // "type": "string"
  2784. // }
  2785. // },
  2786. // "path": "v1alpha1/projects/{projectId}/clusters",
  2787. // "response": {
  2788. // "$ref": "ListClustersResponse"
  2789. // },
  2790. // "scopes": [
  2791. // "https://www.googleapis.com/auth/cloud-platform"
  2792. // ]
  2793. // }
  2794. }
  2795. // Pages invokes f for each page of results.
  2796. // A non-nil error returned from f will halt the iteration.
  2797. // The provided context supersedes any context provided to the Context method.
  2798. func (c *ProjectsClustersListCall) Pages(ctx context.Context, f func(*ListClustersResponse) error) error {
  2799. c.ctx_ = ctx
  2800. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2801. for {
  2802. x, err := c.Do()
  2803. if err != nil {
  2804. return err
  2805. }
  2806. if err := f(x); err != nil {
  2807. return err
  2808. }
  2809. if x.NextPageToken == "" {
  2810. return nil
  2811. }
  2812. c.PageToken(x.NextPageToken)
  2813. }
  2814. }
  2815. // method id "dataproc.projects.clusters.patch":
  2816. type ProjectsClustersPatchCall struct {
  2817. s *Service
  2818. projectId string
  2819. clusterName string
  2820. cluster *Cluster
  2821. urlParams_ gensupport.URLParams
  2822. ctx_ context.Context
  2823. }
  2824. // Patch: Request to update a cluster in a project.
  2825. func (r *ProjectsClustersService) Patch(projectId string, clusterName string, cluster *Cluster) *ProjectsClustersPatchCall {
  2826. c := &ProjectsClustersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2827. c.projectId = projectId
  2828. c.clusterName = clusterName
  2829. c.cluster = cluster
  2830. return c
  2831. }
  2832. // UpdateMask sets the optional parameter "updateMask": [Required]
  2833. // Specifies the path, relative to Cluster, of the field to update. For
  2834. // example, to change the number of workers in a cluster to 5, the
  2835. // update_mask parameter would be specified as
  2836. // "configuration.worker_configuration.num_instances," and the PATCH
  2837. // request body would specify the new value, as follows: {
  2838. // "configuration":{ "workerConfiguration":{ "numInstances":"5" } } }
  2839. // Note: Currently, configuration.worker_configuration.num_instances is
  2840. // the only field that can be updated.
  2841. func (c *ProjectsClustersPatchCall) UpdateMask(updateMask string) *ProjectsClustersPatchCall {
  2842. c.urlParams_.Set("updateMask", updateMask)
  2843. return c
  2844. }
  2845. // Fields allows partial responses to be retrieved. See
  2846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2847. // for more information.
  2848. func (c *ProjectsClustersPatchCall) Fields(s ...googleapi.Field) *ProjectsClustersPatchCall {
  2849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2850. return c
  2851. }
  2852. // Context sets the context to be used in this call's Do method. Any
  2853. // pending HTTP request will be aborted if the provided context is
  2854. // canceled.
  2855. func (c *ProjectsClustersPatchCall) Context(ctx context.Context) *ProjectsClustersPatchCall {
  2856. c.ctx_ = ctx
  2857. return c
  2858. }
  2859. func (c *ProjectsClustersPatchCall) doRequest(alt string) (*http.Response, error) {
  2860. var body io.Reader = nil
  2861. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster)
  2862. if err != nil {
  2863. return nil, err
  2864. }
  2865. ctype := "application/json"
  2866. c.urlParams_.Set("alt", alt)
  2867. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/clusters/{clusterName}")
  2868. urls += "?" + c.urlParams_.Encode()
  2869. req, _ := http.NewRequest("PATCH", urls, body)
  2870. googleapi.Expand(req.URL, map[string]string{
  2871. "projectId": c.projectId,
  2872. "clusterName": c.clusterName,
  2873. })
  2874. req.Header.Set("Content-Type", ctype)
  2875. req.Header.Set("User-Agent", c.s.userAgent())
  2876. if c.ctx_ != nil {
  2877. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2878. }
  2879. return c.s.client.Do(req)
  2880. }
  2881. // Do executes the "dataproc.projects.clusters.patch" call.
  2882. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2883. // status code is an error. Response headers are in either
  2884. // *Operation.ServerResponse.Header or (if a response was returned at
  2885. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2886. // to check whether the returned error was because
  2887. // http.StatusNotModified was returned.
  2888. func (c *ProjectsClustersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2889. gensupport.SetOptions(c.urlParams_, opts...)
  2890. res, err := c.doRequest("json")
  2891. if res != nil && res.StatusCode == http.StatusNotModified {
  2892. if res.Body != nil {
  2893. res.Body.Close()
  2894. }
  2895. return nil, &googleapi.Error{
  2896. Code: res.StatusCode,
  2897. Header: res.Header,
  2898. }
  2899. }
  2900. if err != nil {
  2901. return nil, err
  2902. }
  2903. defer googleapi.CloseBody(res)
  2904. if err := googleapi.CheckResponse(res); err != nil {
  2905. return nil, err
  2906. }
  2907. ret := &Operation{
  2908. ServerResponse: googleapi.ServerResponse{
  2909. Header: res.Header,
  2910. HTTPStatusCode: res.StatusCode,
  2911. },
  2912. }
  2913. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2914. return nil, err
  2915. }
  2916. return ret, nil
  2917. // {
  2918. // "description": "Request to update a cluster in a project.",
  2919. // "httpMethod": "PATCH",
  2920. // "id": "dataproc.projects.clusters.patch",
  2921. // "parameterOrder": [
  2922. // "projectId",
  2923. // "clusterName"
  2924. // ],
  2925. // "parameters": {
  2926. // "clusterName": {
  2927. // "description": "[Required] The cluster name.",
  2928. // "location": "path",
  2929. // "required": true,
  2930. // "type": "string"
  2931. // },
  2932. // "projectId": {
  2933. // "description": "[Required] The ID of the Google Cloud Platform project the cluster belongs to.",
  2934. // "location": "path",
  2935. // "required": true,
  2936. // "type": "string"
  2937. // },
  2938. // "updateMask": {
  2939. // "description": "[Required] Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as \"configuration.worker_configuration.num_instances,\" and the PATCH request body would specify the new value, as follows: { \"configuration\":{ \"workerConfiguration\":{ \"numInstances\":\"5\" } } } Note: Currently, configuration.worker_configuration.num_instances is the only field that can be updated.",
  2940. // "location": "query",
  2941. // "type": "string"
  2942. // }
  2943. // },
  2944. // "path": "v1alpha1/projects/{projectId}/clusters/{clusterName}",
  2945. // "request": {
  2946. // "$ref": "Cluster"
  2947. // },
  2948. // "response": {
  2949. // "$ref": "Operation"
  2950. // },
  2951. // "scopes": [
  2952. // "https://www.googleapis.com/auth/cloud-platform"
  2953. // ]
  2954. // }
  2955. }
  2956. // method id "dataproc.projects.clusters.agents.create":
  2957. type ProjectsClustersAgentsCreateCall struct {
  2958. s *Service
  2959. projectId string
  2960. clusterUuid string
  2961. agentId string
  2962. agent *Agent
  2963. urlParams_ gensupport.URLParams
  2964. ctx_ context.Context
  2965. }
  2966. // Create: Add a new agent to Dataproc's view of a cluster. This is the
  2967. // first Dataproc method that an agent should invoke after starting. If
  2968. // an agent has already been created with the given agent_id within the
  2969. // same cluster, this method will return a Conflict status code and the
  2970. // agent is expected to call GetAgent to retrieve the last registration
  2971. // and subsequently call UpdateAgent, if required.
  2972. func (r *ProjectsClustersAgentsService) Create(projectId string, clusterUuid string, agentId string, agent *Agent) *ProjectsClustersAgentsCreateCall {
  2973. c := &ProjectsClustersAgentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2974. c.projectId = projectId
  2975. c.clusterUuid = clusterUuid
  2976. c.agentId = agentId
  2977. c.agent = agent
  2978. return c
  2979. }
  2980. // Fields allows partial responses to be retrieved. See
  2981. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2982. // for more information.
  2983. func (c *ProjectsClustersAgentsCreateCall) Fields(s ...googleapi.Field) *ProjectsClustersAgentsCreateCall {
  2984. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2985. return c
  2986. }
  2987. // Context sets the context to be used in this call's Do method. Any
  2988. // pending HTTP request will be aborted if the provided context is
  2989. // canceled.
  2990. func (c *ProjectsClustersAgentsCreateCall) Context(ctx context.Context) *ProjectsClustersAgentsCreateCall {
  2991. c.ctx_ = ctx
  2992. return c
  2993. }
  2994. func (c *ProjectsClustersAgentsCreateCall) doRequest(alt string) (*http.Response, error) {
  2995. var body io.Reader = nil
  2996. body, err := googleapi.WithoutDataWrapper.JSONReader(c.agent)
  2997. if err != nil {
  2998. return nil, err
  2999. }
  3000. ctype := "application/json"
  3001. c.urlParams_.Set("alt", alt)
  3002. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/clusters/{clusterUuid}/agents/{agentId}")
  3003. urls += "?" + c.urlParams_.Encode()
  3004. req, _ := http.NewRequest("PUT", urls, body)
  3005. googleapi.Expand(req.URL, map[string]string{
  3006. "projectId": c.projectId,
  3007. "clusterUuid": c.clusterUuid,
  3008. "agentId": c.agentId,
  3009. })
  3010. req.Header.Set("Content-Type", ctype)
  3011. req.Header.Set("User-Agent", c.s.userAgent())
  3012. if c.ctx_ != nil {
  3013. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3014. }
  3015. return c.s.client.Do(req)
  3016. }
  3017. // Do executes the "dataproc.projects.clusters.agents.create" call.
  3018. // Exactly one of *Agent or error will be non-nil. Any non-2xx status
  3019. // code is an error. Response headers are in either
  3020. // *Agent.ServerResponse.Header or (if a response was returned at all)
  3021. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3022. // check whether the returned error was because http.StatusNotModified
  3023. // was returned.
  3024. func (c *ProjectsClustersAgentsCreateCall) Do(opts ...googleapi.CallOption) (*Agent, error) {
  3025. gensupport.SetOptions(c.urlParams_, opts...)
  3026. res, err := c.doRequest("json")
  3027. if res != nil && res.StatusCode == http.StatusNotModified {
  3028. if res.Body != nil {
  3029. res.Body.Close()
  3030. }
  3031. return nil, &googleapi.Error{
  3032. Code: res.StatusCode,
  3033. Header: res.Header,
  3034. }
  3035. }
  3036. if err != nil {
  3037. return nil, err
  3038. }
  3039. defer googleapi.CloseBody(res)
  3040. if err := googleapi.CheckResponse(res); err != nil {
  3041. return nil, err
  3042. }
  3043. ret := &Agent{
  3044. ServerResponse: googleapi.ServerResponse{
  3045. Header: res.Header,
  3046. HTTPStatusCode: res.StatusCode,
  3047. },
  3048. }
  3049. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3050. return nil, err
  3051. }
  3052. return ret, nil
  3053. // {
  3054. // "description": "Add a new agent to Dataproc's view of a cluster. This is the first Dataproc method that an agent should invoke after starting. If an agent has already been created with the given agent_id within the same cluster, this method will return a Conflict status code and the agent is expected to call GetAgent to retrieve the last registration and subsequently call UpdateAgent, if required.",
  3055. // "httpMethod": "PUT",
  3056. // "id": "dataproc.projects.clusters.agents.create",
  3057. // "parameterOrder": [
  3058. // "projectId",
  3059. // "clusterUuid",
  3060. // "agentId"
  3061. // ],
  3062. // "parameters": {
  3063. // "agentId": {
  3064. // "description": "[Required] Agent ID being registered.",
  3065. // "location": "path",
  3066. // "required": true,
  3067. // "type": "string"
  3068. // },
  3069. // "clusterUuid": {
  3070. // "description": "Cluster that this agent is associated with",
  3071. // "location": "path",
  3072. // "required": true,
  3073. // "type": "string"
  3074. // },
  3075. // "projectId": {
  3076. // "description": "Project ID that this agent is associated with",
  3077. // "location": "path",
  3078. // "required": true,
  3079. // "type": "string"
  3080. // }
  3081. // },
  3082. // "path": "v1alpha1/projects/{projectId}/clusters/{clusterUuid}/agents/{agentId}",
  3083. // "request": {
  3084. // "$ref": "Agent"
  3085. // },
  3086. // "response": {
  3087. // "$ref": "Agent"
  3088. // },
  3089. // "scopes": [
  3090. // "https://www.googleapis.com/auth/cloud-platform",
  3091. // "https://www.googleapis.com/auth/logging.admin",
  3092. // "https://www.googleapis.com/auth/logging.read",
  3093. // "https://www.googleapis.com/auth/logging.write"
  3094. // ]
  3095. // }
  3096. }
  3097. // method id "dataproc.projects.clusters.agents.delete":
  3098. type ProjectsClustersAgentsDeleteCall struct {
  3099. s *Service
  3100. projectId string
  3101. clusterUuid string
  3102. agentId string
  3103. urlParams_ gensupport.URLParams
  3104. ctx_ context.Context
  3105. }
  3106. // Delete: Delete an agent from Dataproc's view of a cluster. Deleting
  3107. // an agent is not required, but could be used in a shutdown sequence to
  3108. // indicate to Dataproc that the agent is to be considered dead and all
  3109. // agent-owned resources and tasks are free to be re-distributed.
  3110. func (r *ProjectsClustersAgentsService) Delete(projectId string, clusterUuid string, agentId string) *ProjectsClustersAgentsDeleteCall {
  3111. c := &ProjectsClustersAgentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3112. c.projectId = projectId
  3113. c.clusterUuid = clusterUuid
  3114. c.agentId = agentId
  3115. return c
  3116. }
  3117. // Fields allows partial responses to be retrieved. See
  3118. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3119. // for more information.
  3120. func (c *ProjectsClustersAgentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsClustersAgentsDeleteCall {
  3121. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3122. return c
  3123. }
  3124. // Context sets the context to be used in this call's Do method. Any
  3125. // pending HTTP request will be aborted if the provided context is
  3126. // canceled.
  3127. func (c *ProjectsClustersAgentsDeleteCall) Context(ctx context.Context) *ProjectsClustersAgentsDeleteCall {
  3128. c.ctx_ = ctx
  3129. return c
  3130. }
  3131. func (c *ProjectsClustersAgentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3132. var body io.Reader = nil
  3133. c.urlParams_.Set("alt", alt)
  3134. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/clusters/{clusterUuid}/agents/{agentId}")
  3135. urls += "?" + c.urlParams_.Encode()
  3136. req, _ := http.NewRequest("DELETE", urls, body)
  3137. googleapi.Expand(req.URL, map[string]string{
  3138. "projectId": c.projectId,
  3139. "clusterUuid": c.clusterUuid,
  3140. "agentId": c.agentId,
  3141. })
  3142. req.Header.Set("User-Agent", c.s.userAgent())
  3143. if c.ctx_ != nil {
  3144. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3145. }
  3146. return c.s.client.Do(req)
  3147. }
  3148. // Do executes the "dataproc.projects.clusters.agents.delete" call.
  3149. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  3150. // code is an error. Response headers are in either
  3151. // *Empty.ServerResponse.Header or (if a response was returned at all)
  3152. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3153. // check whether the returned error was because http.StatusNotModified
  3154. // was returned.
  3155. func (c *ProjectsClustersAgentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3156. gensupport.SetOptions(c.urlParams_, opts...)
  3157. res, err := c.doRequest("json")
  3158. if res != nil && res.StatusCode == http.StatusNotModified {
  3159. if res.Body != nil {
  3160. res.Body.Close()
  3161. }
  3162. return nil, &googleapi.Error{
  3163. Code: res.StatusCode,
  3164. Header: res.Header,
  3165. }
  3166. }
  3167. if err != nil {
  3168. return nil, err
  3169. }
  3170. defer googleapi.CloseBody(res)
  3171. if err := googleapi.CheckResponse(res); err != nil {
  3172. return nil, err
  3173. }
  3174. ret := &Empty{
  3175. ServerResponse: googleapi.ServerResponse{
  3176. Header: res.Header,
  3177. HTTPStatusCode: res.StatusCode,
  3178. },
  3179. }
  3180. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3181. return nil, err
  3182. }
  3183. return ret, nil
  3184. // {
  3185. // "description": "Delete an agent from Dataproc's view of a cluster. Deleting an agent is not required, but could be used in a shutdown sequence to indicate to Dataproc that the agent is to be considered dead and all agent-owned resources and tasks are free to be re-distributed.",
  3186. // "httpMethod": "DELETE",
  3187. // "id": "dataproc.projects.clusters.agents.delete",
  3188. // "parameterOrder": [
  3189. // "projectId",
  3190. // "clusterUuid",
  3191. // "agentId"
  3192. // ],
  3193. // "parameters": {
  3194. // "agentId": {
  3195. // "description": "The agent.",
  3196. // "location": "path",
  3197. // "required": true,
  3198. // "type": "string"
  3199. // },
  3200. // "clusterUuid": {
  3201. // "description": "The agent's cluster.",
  3202. // "location": "path",
  3203. // "required": true,
  3204. // "type": "string"
  3205. // },
  3206. // "projectId": {
  3207. // "description": "The agent's project.",
  3208. // "location": "path",
  3209. // "required": true,
  3210. // "type": "string"
  3211. // }
  3212. // },
  3213. // "path": "v1alpha1/projects/{projectId}/clusters/{clusterUuid}/agents/{agentId}",
  3214. // "response": {
  3215. // "$ref": "Empty"
  3216. // },
  3217. // "scopes": [
  3218. // "https://www.googleapis.com/auth/cloud-platform",
  3219. // "https://www.googleapis.com/auth/logging.admin",
  3220. // "https://www.googleapis.com/auth/logging.read",
  3221. // "https://www.googleapis.com/auth/logging.write"
  3222. // ]
  3223. // }
  3224. }
  3225. // method id "dataproc.projects.clusters.agents.get":
  3226. type ProjectsClustersAgentsGetCall struct {
  3227. s *Service
  3228. projectId string
  3229. clusterUuid string
  3230. agentId string
  3231. urlParams_ gensupport.URLParams
  3232. ifNoneMatch_ string
  3233. ctx_ context.Context
  3234. }
  3235. // Get: Retrieve an agent.
  3236. func (r *ProjectsClustersAgentsService) Get(projectId string, clusterUuid string, agentId string) *ProjectsClustersAgentsGetCall {
  3237. c := &ProjectsClustersAgentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3238. c.projectId = projectId
  3239. c.clusterUuid = clusterUuid
  3240. c.agentId = agentId
  3241. return c
  3242. }
  3243. // Fields allows partial responses to be retrieved. See
  3244. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3245. // for more information.
  3246. func (c *ProjectsClustersAgentsGetCall) Fields(s ...googleapi.Field) *ProjectsClustersAgentsGetCall {
  3247. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3248. return c
  3249. }
  3250. // IfNoneMatch sets the optional parameter which makes the operation
  3251. // fail if the object's ETag matches the given value. This is useful for
  3252. // getting updates only after the object has changed since the last
  3253. // request. Use googleapi.IsNotModified to check whether the response
  3254. // error from Do is the result of In-None-Match.
  3255. func (c *ProjectsClustersAgentsGetCall) IfNoneMatch(entityTag string) *ProjectsClustersAgentsGetCall {
  3256. c.ifNoneMatch_ = entityTag
  3257. return c
  3258. }
  3259. // Context sets the context to be used in this call's Do method. Any
  3260. // pending HTTP request will be aborted if the provided context is
  3261. // canceled.
  3262. func (c *ProjectsClustersAgentsGetCall) Context(ctx context.Context) *ProjectsClustersAgentsGetCall {
  3263. c.ctx_ = ctx
  3264. return c
  3265. }
  3266. func (c *ProjectsClustersAgentsGetCall) doRequest(alt string) (*http.Response, error) {
  3267. var body io.Reader = nil
  3268. c.urlParams_.Set("alt", alt)
  3269. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/clusters/{clusterUuid}/agents/{agentId}")
  3270. urls += "?" + c.urlParams_.Encode()
  3271. req, _ := http.NewRequest("GET", urls, body)
  3272. googleapi.Expand(req.URL, map[string]string{
  3273. "projectId": c.projectId,
  3274. "clusterUuid": c.clusterUuid,
  3275. "agentId": c.agentId,
  3276. })
  3277. req.Header.Set("User-Agent", c.s.userAgent())
  3278. if c.ifNoneMatch_ != "" {
  3279. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3280. }
  3281. if c.ctx_ != nil {
  3282. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3283. }
  3284. return c.s.client.Do(req)
  3285. }
  3286. // Do executes the "dataproc.projects.clusters.agents.get" call.
  3287. // Exactly one of *Agent or error will be non-nil. Any non-2xx status
  3288. // code is an error. Response headers are in either
  3289. // *Agent.ServerResponse.Header or (if a response was returned at all)
  3290. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3291. // check whether the returned error was because http.StatusNotModified
  3292. // was returned.
  3293. func (c *ProjectsClustersAgentsGetCall) Do(opts ...googleapi.CallOption) (*Agent, error) {
  3294. gensupport.SetOptions(c.urlParams_, opts...)
  3295. res, err := c.doRequest("json")
  3296. if res != nil && res.StatusCode == http.StatusNotModified {
  3297. if res.Body != nil {
  3298. res.Body.Close()
  3299. }
  3300. return nil, &googleapi.Error{
  3301. Code: res.StatusCode,
  3302. Header: res.Header,
  3303. }
  3304. }
  3305. if err != nil {
  3306. return nil, err
  3307. }
  3308. defer googleapi.CloseBody(res)
  3309. if err := googleapi.CheckResponse(res); err != nil {
  3310. return nil, err
  3311. }
  3312. ret := &Agent{
  3313. ServerResponse: googleapi.ServerResponse{
  3314. Header: res.Header,
  3315. HTTPStatusCode: res.StatusCode,
  3316. },
  3317. }
  3318. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3319. return nil, err
  3320. }
  3321. return ret, nil
  3322. // {
  3323. // "description": "Retrieve an agent.",
  3324. // "httpMethod": "GET",
  3325. // "id": "dataproc.projects.clusters.agents.get",
  3326. // "parameterOrder": [
  3327. // "projectId",
  3328. // "clusterUuid",
  3329. // "agentId"
  3330. // ],
  3331. // "parameters": {
  3332. // "agentId": {
  3333. // "description": "The agent's ID.",
  3334. // "location": "path",
  3335. // "required": true,
  3336. // "type": "string"
  3337. // },
  3338. // "clusterUuid": {
  3339. // "description": "The agent's cluster.",
  3340. // "location": "path",
  3341. // "required": true,
  3342. // "type": "string"
  3343. // },
  3344. // "projectId": {
  3345. // "description": "The agent's project ID.",
  3346. // "location": "path",
  3347. // "required": true,
  3348. // "type": "string"
  3349. // }
  3350. // },
  3351. // "path": "v1alpha1/projects/{projectId}/clusters/{clusterUuid}/agents/{agentId}",
  3352. // "response": {
  3353. // "$ref": "Agent"
  3354. // },
  3355. // "scopes": [
  3356. // "https://www.googleapis.com/auth/cloud-platform",
  3357. // "https://www.googleapis.com/auth/logging.admin",
  3358. // "https://www.googleapis.com/auth/logging.read",
  3359. // "https://www.googleapis.com/auth/logging.write"
  3360. // ]
  3361. // }
  3362. }
  3363. // method id "dataproc.projects.clusters.agents.list":
  3364. type ProjectsClustersAgentsListCall struct {
  3365. s *Service
  3366. projectId string
  3367. clusterUuid string
  3368. urlParams_ gensupport.URLParams
  3369. ifNoneMatch_ string
  3370. ctx_ context.Context
  3371. }
  3372. // List: List all agents Dataproc is aware of within a cluster.
  3373. func (r *ProjectsClustersAgentsService) List(projectId string, clusterUuid string) *ProjectsClustersAgentsListCall {
  3374. c := &ProjectsClustersAgentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3375. c.projectId = projectId
  3376. c.clusterUuid = clusterUuid
  3377. return c
  3378. }
  3379. // PageSize sets the optional parameter "pageSize": Requested page size
  3380. // for listing.
  3381. func (c *ProjectsClustersAgentsListCall) PageSize(pageSize int64) *ProjectsClustersAgentsListCall {
  3382. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3383. return c
  3384. }
  3385. // PageToken sets the optional parameter "pageToken": Page continuation
  3386. // token.
  3387. func (c *ProjectsClustersAgentsListCall) PageToken(pageToken string) *ProjectsClustersAgentsListCall {
  3388. c.urlParams_.Set("pageToken", pageToken)
  3389. return c
  3390. }
  3391. // Fields allows partial responses to be retrieved. See
  3392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3393. // for more information.
  3394. func (c *ProjectsClustersAgentsListCall) Fields(s ...googleapi.Field) *ProjectsClustersAgentsListCall {
  3395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3396. return c
  3397. }
  3398. // IfNoneMatch sets the optional parameter which makes the operation
  3399. // fail if the object's ETag matches the given value. This is useful for
  3400. // getting updates only after the object has changed since the last
  3401. // request. Use googleapi.IsNotModified to check whether the response
  3402. // error from Do is the result of In-None-Match.
  3403. func (c *ProjectsClustersAgentsListCall) IfNoneMatch(entityTag string) *ProjectsClustersAgentsListCall {
  3404. c.ifNoneMatch_ = entityTag
  3405. return c
  3406. }
  3407. // Context sets the context to be used in this call's Do method. Any
  3408. // pending HTTP request will be aborted if the provided context is
  3409. // canceled.
  3410. func (c *ProjectsClustersAgentsListCall) Context(ctx context.Context) *ProjectsClustersAgentsListCall {
  3411. c.ctx_ = ctx
  3412. return c
  3413. }
  3414. func (c *ProjectsClustersAgentsListCall) doRequest(alt string) (*http.Response, error) {
  3415. var body io.Reader = nil
  3416. c.urlParams_.Set("alt", alt)
  3417. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/clusters/{clusterUuid}/agents")
  3418. urls += "?" + c.urlParams_.Encode()
  3419. req, _ := http.NewRequest("GET", urls, body)
  3420. googleapi.Expand(req.URL, map[string]string{
  3421. "projectId": c.projectId,
  3422. "clusterUuid": c.clusterUuid,
  3423. })
  3424. req.Header.Set("User-Agent", c.s.userAgent())
  3425. if c.ifNoneMatch_ != "" {
  3426. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3427. }
  3428. if c.ctx_ != nil {
  3429. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3430. }
  3431. return c.s.client.Do(req)
  3432. }
  3433. // Do executes the "dataproc.projects.clusters.agents.list" call.
  3434. // Exactly one of *ListAgentsResponse or error will be non-nil. Any
  3435. // non-2xx status code is an error. Response headers are in either
  3436. // *ListAgentsResponse.ServerResponse.Header or (if a response was
  3437. // returned at all) in error.(*googleapi.Error).Header. Use
  3438. // googleapi.IsNotModified to check whether the returned error was
  3439. // because http.StatusNotModified was returned.
  3440. func (c *ProjectsClustersAgentsListCall) Do(opts ...googleapi.CallOption) (*ListAgentsResponse, error) {
  3441. gensupport.SetOptions(c.urlParams_, opts...)
  3442. res, err := c.doRequest("json")
  3443. if res != nil && res.StatusCode == http.StatusNotModified {
  3444. if res.Body != nil {
  3445. res.Body.Close()
  3446. }
  3447. return nil, &googleapi.Error{
  3448. Code: res.StatusCode,
  3449. Header: res.Header,
  3450. }
  3451. }
  3452. if err != nil {
  3453. return nil, err
  3454. }
  3455. defer googleapi.CloseBody(res)
  3456. if err := googleapi.CheckResponse(res); err != nil {
  3457. return nil, err
  3458. }
  3459. ret := &ListAgentsResponse{
  3460. ServerResponse: googleapi.ServerResponse{
  3461. Header: res.Header,
  3462. HTTPStatusCode: res.StatusCode,
  3463. },
  3464. }
  3465. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3466. return nil, err
  3467. }
  3468. return ret, nil
  3469. // {
  3470. // "description": "List all agents Dataproc is aware of within a cluster.",
  3471. // "httpMethod": "GET",
  3472. // "id": "dataproc.projects.clusters.agents.list",
  3473. // "parameterOrder": [
  3474. // "projectId",
  3475. // "clusterUuid"
  3476. // ],
  3477. // "parameters": {
  3478. // "clusterUuid": {
  3479. // "description": "The cluster from which to list agents.",
  3480. // "location": "path",
  3481. // "required": true,
  3482. // "type": "string"
  3483. // },
  3484. // "pageSize": {
  3485. // "description": "Requested page size for listing.",
  3486. // "format": "int32",
  3487. // "location": "query",
  3488. // "type": "integer"
  3489. // },
  3490. // "pageToken": {
  3491. // "description": "Page continuation token.",
  3492. // "location": "query",
  3493. // "type": "string"
  3494. // },
  3495. // "projectId": {
  3496. // "description": "The project from which to list agents.",
  3497. // "location": "path",
  3498. // "required": true,
  3499. // "type": "string"
  3500. // }
  3501. // },
  3502. // "path": "v1alpha1/projects/{projectId}/clusters/{clusterUuid}/agents",
  3503. // "response": {
  3504. // "$ref": "ListAgentsResponse"
  3505. // },
  3506. // "scopes": [
  3507. // "https://www.googleapis.com/auth/cloud-platform",
  3508. // "https://www.googleapis.com/auth/logging.admin",
  3509. // "https://www.googleapis.com/auth/logging.read",
  3510. // "https://www.googleapis.com/auth/logging.write"
  3511. // ]
  3512. // }
  3513. }
  3514. // Pages invokes f for each page of results.
  3515. // A non-nil error returned from f will halt the iteration.
  3516. // The provided context supersedes any context provided to the Context method.
  3517. func (c *ProjectsClustersAgentsListCall) Pages(ctx context.Context, f func(*ListAgentsResponse) error) error {
  3518. c.ctx_ = ctx
  3519. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3520. for {
  3521. x, err := c.Do()
  3522. if err != nil {
  3523. return err
  3524. }
  3525. if err := f(x); err != nil {
  3526. return err
  3527. }
  3528. if x.NextPageToken == "" {
  3529. return nil
  3530. }
  3531. c.PageToken(x.NextPageToken)
  3532. }
  3533. }
  3534. // method id "dataproc.projects.clusters.agents.update":
  3535. type ProjectsClustersAgentsUpdateCall struct {
  3536. s *Service
  3537. projectId string
  3538. clusterUuid string
  3539. agentId string
  3540. agent *Agent
  3541. urlParams_ gensupport.URLParams
  3542. ctx_ context.Context
  3543. }
  3544. // Update: Update Dataproc's view of an agent. This is currently used to
  3545. // provide a is_healthy bit, but is expected to be extended to include
  3546. // daemon information and VM metrics for inclusion in cloud metrics.
  3547. func (r *ProjectsClustersAgentsService) Update(projectId string, clusterUuid string, agentId string, agent *Agent) *ProjectsClustersAgentsUpdateCall {
  3548. c := &ProjectsClustersAgentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3549. c.projectId = projectId
  3550. c.clusterUuid = clusterUuid
  3551. c.agentId = agentId
  3552. c.agent = agent
  3553. return c
  3554. }
  3555. // Fields allows partial responses to be retrieved. See
  3556. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3557. // for more information.
  3558. func (c *ProjectsClustersAgentsUpdateCall) Fields(s ...googleapi.Field) *ProjectsClustersAgentsUpdateCall {
  3559. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3560. return c
  3561. }
  3562. // Context sets the context to be used in this call's Do method. Any
  3563. // pending HTTP request will be aborted if the provided context is
  3564. // canceled.
  3565. func (c *ProjectsClustersAgentsUpdateCall) Context(ctx context.Context) *ProjectsClustersAgentsUpdateCall {
  3566. c.ctx_ = ctx
  3567. return c
  3568. }
  3569. func (c *ProjectsClustersAgentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  3570. var body io.Reader = nil
  3571. body, err := googleapi.WithoutDataWrapper.JSONReader(c.agent)
  3572. if err != nil {
  3573. return nil, err
  3574. }
  3575. ctype := "application/json"
  3576. c.urlParams_.Set("alt", alt)
  3577. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/clusters/{clusterUuid}/agents/{agentId}")
  3578. urls += "?" + c.urlParams_.Encode()
  3579. req, _ := http.NewRequest("PUT", urls, body)
  3580. googleapi.Expand(req.URL, map[string]string{
  3581. "projectId": c.projectId,
  3582. "clusterUuid": c.clusterUuid,
  3583. "agentId": c.agentId,
  3584. })
  3585. req.Header.Set("Content-Type", ctype)
  3586. req.Header.Set("User-Agent", c.s.userAgent())
  3587. if c.ctx_ != nil {
  3588. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3589. }
  3590. return c.s.client.Do(req)
  3591. }
  3592. // Do executes the "dataproc.projects.clusters.agents.update" call.
  3593. // Exactly one of *Agent or error will be non-nil. Any non-2xx status
  3594. // code is an error. Response headers are in either
  3595. // *Agent.ServerResponse.Header or (if a response was returned at all)
  3596. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3597. // check whether the returned error was because http.StatusNotModified
  3598. // was returned.
  3599. func (c *ProjectsClustersAgentsUpdateCall) Do(opts ...googleapi.CallOption) (*Agent, error) {
  3600. gensupport.SetOptions(c.urlParams_, opts...)
  3601. res, err := c.doRequest("json")
  3602. if res != nil && res.StatusCode == http.StatusNotModified {
  3603. if res.Body != nil {
  3604. res.Body.Close()
  3605. }
  3606. return nil, &googleapi.Error{
  3607. Code: res.StatusCode,
  3608. Header: res.Header,
  3609. }
  3610. }
  3611. if err != nil {
  3612. return nil, err
  3613. }
  3614. defer googleapi.CloseBody(res)
  3615. if err := googleapi.CheckResponse(res); err != nil {
  3616. return nil, err
  3617. }
  3618. ret := &Agent{
  3619. ServerResponse: googleapi.ServerResponse{
  3620. Header: res.Header,
  3621. HTTPStatusCode: res.StatusCode,
  3622. },
  3623. }
  3624. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3625. return nil, err
  3626. }
  3627. return ret, nil
  3628. // {
  3629. // "description": "Update Dataproc's view of an agent. This is currently used to provide a is_healthy bit, but is expected to be extended to include daemon information and VM metrics for inclusion in cloud metrics.",
  3630. // "httpMethod": "PUT",
  3631. // "id": "dataproc.projects.clusters.agents.update",
  3632. // "parameterOrder": [
  3633. // "projectId",
  3634. // "clusterUuid",
  3635. // "agentId"
  3636. // ],
  3637. // "parameters": {
  3638. // "agentId": {
  3639. // "description": "[Required] ID of agent sending the update.",
  3640. // "location": "path",
  3641. // "required": true,
  3642. // "type": "string"
  3643. // },
  3644. // "clusterUuid": {
  3645. // "description": "The cluster on which the agent is running.",
  3646. // "location": "path",
  3647. // "required": true,
  3648. // "type": "string"
  3649. // },
  3650. // "projectId": {
  3651. // "description": "The agent's project.",
  3652. // "location": "path",
  3653. // "required": true,
  3654. // "type": "string"
  3655. // }
  3656. // },
  3657. // "path": "v1alpha1/projects/{projectId}/clusters/{clusterUuid}/agents/{agentId}",
  3658. // "request": {
  3659. // "$ref": "Agent"
  3660. // },
  3661. // "response": {
  3662. // "$ref": "Agent"
  3663. // },
  3664. // "scopes": [
  3665. // "https://www.googleapis.com/auth/cloud-platform",
  3666. // "https://www.googleapis.com/auth/logging.admin",
  3667. // "https://www.googleapis.com/auth/logging.read",
  3668. // "https://www.googleapis.com/auth/logging.write"
  3669. // ]
  3670. // }
  3671. }
  3672. // method id "dataproc.projects.clusters.tasks.lease":
  3673. type ProjectsClustersTasksLeaseCall struct {
  3674. s *Service
  3675. projectId string
  3676. clusterUuid string
  3677. leasetasksrequest *LeaseTasksRequest
  3678. urlParams_ gensupport.URLParams
  3679. ctx_ context.Context
  3680. }
  3681. // Lease: Obtain a lease on one or more tasks. Any given task may be in
  3682. // any state and each agent is expected to start any non-started tasks
  3683. // and to monitor any YarnApplications spawned by any already running
  3684. // tasks. It's expected that monitoring previously launched tasks will
  3685. // be more prevalent when drivers are run entirely within YARN
  3686. // containers. While there's a single lease expiration time, in the
  3687. // event of multiple tasks being leased to the agent in a single call,
  3688. // each task has a unique lease and status must be reported before the
  3689. // lease times out or the task can be considered orphaned. The service
  3690. // will determine how many tasks to lease to agents in a single call.
  3691. func (r *ProjectsClustersTasksService) Lease(projectId string, clusterUuid string, leasetasksrequest *LeaseTasksRequest) *ProjectsClustersTasksLeaseCall {
  3692. c := &ProjectsClustersTasksLeaseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3693. c.projectId = projectId
  3694. c.clusterUuid = clusterUuid
  3695. c.leasetasksrequest = leasetasksrequest
  3696. return c
  3697. }
  3698. // Fields allows partial responses to be retrieved. See
  3699. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3700. // for more information.
  3701. func (c *ProjectsClustersTasksLeaseCall) Fields(s ...googleapi.Field) *ProjectsClustersTasksLeaseCall {
  3702. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3703. return c
  3704. }
  3705. // Context sets the context to be used in this call's Do method. Any
  3706. // pending HTTP request will be aborted if the provided context is
  3707. // canceled.
  3708. func (c *ProjectsClustersTasksLeaseCall) Context(ctx context.Context) *ProjectsClustersTasksLeaseCall {
  3709. c.ctx_ = ctx
  3710. return c
  3711. }
  3712. func (c *ProjectsClustersTasksLeaseCall) doRequest(alt string) (*http.Response, error) {
  3713. var body io.Reader = nil
  3714. body, err := googleapi.WithoutDataWrapper.JSONReader(c.leasetasksrequest)
  3715. if err != nil {
  3716. return nil, err
  3717. }
  3718. ctype := "application/json"
  3719. c.urlParams_.Set("alt", alt)
  3720. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/clusters/{clusterUuid}/tasks:lease")
  3721. urls += "?" + c.urlParams_.Encode()
  3722. req, _ := http.NewRequest("POST", urls, body)
  3723. googleapi.Expand(req.URL, map[string]string{
  3724. "projectId": c.projectId,
  3725. "clusterUuid": c.clusterUuid,
  3726. })
  3727. req.Header.Set("Content-Type", ctype)
  3728. req.Header.Set("User-Agent", c.s.userAgent())
  3729. if c.ctx_ != nil {
  3730. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3731. }
  3732. return c.s.client.Do(req)
  3733. }
  3734. // Do executes the "dataproc.projects.clusters.tasks.lease" call.
  3735. // Exactly one of *LeaseTasksResponse or error will be non-nil. Any
  3736. // non-2xx status code is an error. Response headers are in either
  3737. // *LeaseTasksResponse.ServerResponse.Header or (if a response was
  3738. // returned at all) in error.(*googleapi.Error).Header. Use
  3739. // googleapi.IsNotModified to check whether the returned error was
  3740. // because http.StatusNotModified was returned.
  3741. func (c *ProjectsClustersTasksLeaseCall) Do(opts ...googleapi.CallOption) (*LeaseTasksResponse, error) {
  3742. gensupport.SetOptions(c.urlParams_, opts...)
  3743. res, err := c.doRequest("json")
  3744. if res != nil && res.StatusCode == http.StatusNotModified {
  3745. if res.Body != nil {
  3746. res.Body.Close()
  3747. }
  3748. return nil, &googleapi.Error{
  3749. Code: res.StatusCode,
  3750. Header: res.Header,
  3751. }
  3752. }
  3753. if err != nil {
  3754. return nil, err
  3755. }
  3756. defer googleapi.CloseBody(res)
  3757. if err := googleapi.CheckResponse(res); err != nil {
  3758. return nil, err
  3759. }
  3760. ret := &LeaseTasksResponse{
  3761. ServerResponse: googleapi.ServerResponse{
  3762. Header: res.Header,
  3763. HTTPStatusCode: res.StatusCode,
  3764. },
  3765. }
  3766. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3767. return nil, err
  3768. }
  3769. return ret, nil
  3770. // {
  3771. // "description": "Obtain a lease on one or more tasks. Any given task may be in any state and each agent is expected to start any non-started tasks and to monitor any YarnApplications spawned by any already running tasks. It's expected that monitoring previously launched tasks will be more prevalent when drivers are run entirely within YARN containers. While there's a single lease expiration time, in the event of multiple tasks being leased to the agent in a single call, each task has a unique lease and status must be reported before the lease times out or the task can be considered orphaned. The service will determine how many tasks to lease to agents in a single call.",
  3772. // "httpMethod": "POST",
  3773. // "id": "dataproc.projects.clusters.tasks.lease",
  3774. // "parameterOrder": [
  3775. // "projectId",
  3776. // "clusterUuid"
  3777. // ],
  3778. // "parameters": {
  3779. // "clusterUuid": {
  3780. // "description": "The cluster id of the agent.",
  3781. // "location": "path",
  3782. // "required": true,
  3783. // "type": "string"
  3784. // },
  3785. // "projectId": {
  3786. // "description": "The project id of the agent.",
  3787. // "location": "path",
  3788. // "required": true,
  3789. // "type": "string"
  3790. // }
  3791. // },
  3792. // "path": "v1alpha1/projects/{projectId}/clusters/{clusterUuid}/tasks:lease",
  3793. // "request": {
  3794. // "$ref": "LeaseTasksRequest"
  3795. // },
  3796. // "response": {
  3797. // "$ref": "LeaseTasksResponse"
  3798. // },
  3799. // "scopes": [
  3800. // "https://www.googleapis.com/auth/cloud-platform",
  3801. // "https://www.googleapis.com/auth/logging.admin",
  3802. // "https://www.googleapis.com/auth/logging.read",
  3803. // "https://www.googleapis.com/auth/logging.write"
  3804. // ]
  3805. // }
  3806. }
  3807. // method id "dataproc.projects.clusters.tasks.report":
  3808. type ProjectsClustersTasksReportCall struct {
  3809. s *Service
  3810. projectId string
  3811. clusterUuid string
  3812. taskId string
  3813. reporttaskstatusrequest *ReportTaskStatusRequest
  3814. urlParams_ gensupport.URLParams
  3815. ctx_ context.Context
  3816. }
  3817. // Report: Report status for a task and extend the lease provided for
  3818. // the task.
  3819. func (r *ProjectsClustersTasksService) Report(projectId string, clusterUuid string, taskId string, reporttaskstatusrequest *ReportTaskStatusRequest) *ProjectsClustersTasksReportCall {
  3820. c := &ProjectsClustersTasksReportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3821. c.projectId = projectId
  3822. c.clusterUuid = clusterUuid
  3823. c.taskId = taskId
  3824. c.reporttaskstatusrequest = reporttaskstatusrequest
  3825. return c
  3826. }
  3827. // Fields allows partial responses to be retrieved. See
  3828. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3829. // for more information.
  3830. func (c *ProjectsClustersTasksReportCall) Fields(s ...googleapi.Field) *ProjectsClustersTasksReportCall {
  3831. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3832. return c
  3833. }
  3834. // Context sets the context to be used in this call's Do method. Any
  3835. // pending HTTP request will be aborted if the provided context is
  3836. // canceled.
  3837. func (c *ProjectsClustersTasksReportCall) Context(ctx context.Context) *ProjectsClustersTasksReportCall {
  3838. c.ctx_ = ctx
  3839. return c
  3840. }
  3841. func (c *ProjectsClustersTasksReportCall) doRequest(alt string) (*http.Response, error) {
  3842. var body io.Reader = nil
  3843. body, err := googleapi.WithoutDataWrapper.JSONReader(c.reporttaskstatusrequest)
  3844. if err != nil {
  3845. return nil, err
  3846. }
  3847. ctype := "application/json"
  3848. c.urlParams_.Set("alt", alt)
  3849. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/clusters/{clusterUuid}/tasks/{taskId}:report")
  3850. urls += "?" + c.urlParams_.Encode()
  3851. req, _ := http.NewRequest("POST", urls, body)
  3852. googleapi.Expand(req.URL, map[string]string{
  3853. "projectId": c.projectId,
  3854. "clusterUuid": c.clusterUuid,
  3855. "taskId": c.taskId,
  3856. })
  3857. req.Header.Set("Content-Type", ctype)
  3858. req.Header.Set("User-Agent", c.s.userAgent())
  3859. if c.ctx_ != nil {
  3860. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3861. }
  3862. return c.s.client.Do(req)
  3863. }
  3864. // Do executes the "dataproc.projects.clusters.tasks.report" call.
  3865. // Exactly one of *ReportTaskStatusResponse or error will be non-nil.
  3866. // Any non-2xx status code is an error. Response headers are in either
  3867. // *ReportTaskStatusResponse.ServerResponse.Header or (if a response was
  3868. // returned at all) in error.(*googleapi.Error).Header. Use
  3869. // googleapi.IsNotModified to check whether the returned error was
  3870. // because http.StatusNotModified was returned.
  3871. func (c *ProjectsClustersTasksReportCall) Do(opts ...googleapi.CallOption) (*ReportTaskStatusResponse, error) {
  3872. gensupport.SetOptions(c.urlParams_, opts...)
  3873. res, err := c.doRequest("json")
  3874. if res != nil && res.StatusCode == http.StatusNotModified {
  3875. if res.Body != nil {
  3876. res.Body.Close()
  3877. }
  3878. return nil, &googleapi.Error{
  3879. Code: res.StatusCode,
  3880. Header: res.Header,
  3881. }
  3882. }
  3883. if err != nil {
  3884. return nil, err
  3885. }
  3886. defer googleapi.CloseBody(res)
  3887. if err := googleapi.CheckResponse(res); err != nil {
  3888. return nil, err
  3889. }
  3890. ret := &ReportTaskStatusResponse{
  3891. ServerResponse: googleapi.ServerResponse{
  3892. Header: res.Header,
  3893. HTTPStatusCode: res.StatusCode,
  3894. },
  3895. }
  3896. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3897. return nil, err
  3898. }
  3899. return ret, nil
  3900. // {
  3901. // "description": "Report status for a task and extend the lease provided for the task.",
  3902. // "httpMethod": "POST",
  3903. // "id": "dataproc.projects.clusters.tasks.report",
  3904. // "parameterOrder": [
  3905. // "projectId",
  3906. // "clusterUuid",
  3907. // "taskId"
  3908. // ],
  3909. // "parameters": {
  3910. // "clusterUuid": {
  3911. // "description": "The cluster id of the agent.",
  3912. // "location": "path",
  3913. // "required": true,
  3914. // "type": "string"
  3915. // },
  3916. // "projectId": {
  3917. // "description": "The project id of the agent.",
  3918. // "location": "path",
  3919. // "required": true,
  3920. // "type": "string"
  3921. // },
  3922. // "taskId": {
  3923. // "description": "The task that is being reported on.",
  3924. // "location": "path",
  3925. // "required": true,
  3926. // "type": "string"
  3927. // }
  3928. // },
  3929. // "path": "v1alpha1/projects/{projectId}/clusters/{clusterUuid}/tasks/{taskId}:report",
  3930. // "request": {
  3931. // "$ref": "ReportTaskStatusRequest"
  3932. // },
  3933. // "response": {
  3934. // "$ref": "ReportTaskStatusResponse"
  3935. // },
  3936. // "scopes": [
  3937. // "https://www.googleapis.com/auth/cloud-platform",
  3938. // "https://www.googleapis.com/auth/logging.admin",
  3939. // "https://www.googleapis.com/auth/logging.read",
  3940. // "https://www.googleapis.com/auth/logging.write"
  3941. // ]
  3942. // }
  3943. }
  3944. // method id "dataproc.projects.jobs.cancel":
  3945. type ProjectsJobsCancelCall struct {
  3946. s *Service
  3947. projectId string
  3948. jobId string
  3949. canceljobrequest *CancelJobRequest
  3950. urlParams_ gensupport.URLParams
  3951. ctx_ context.Context
  3952. }
  3953. // Cancel: Starts a job cancellation request. To access the job resource
  3954. // after cancellation, call jobs:list or jobs:get.
  3955. func (r *ProjectsJobsService) Cancel(projectId string, jobId string, canceljobrequest *CancelJobRequest) *ProjectsJobsCancelCall {
  3956. c := &ProjectsJobsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3957. c.projectId = projectId
  3958. c.jobId = jobId
  3959. c.canceljobrequest = canceljobrequest
  3960. return c
  3961. }
  3962. // Fields allows partial responses to be retrieved. See
  3963. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3964. // for more information.
  3965. func (c *ProjectsJobsCancelCall) Fields(s ...googleapi.Field) *ProjectsJobsCancelCall {
  3966. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3967. return c
  3968. }
  3969. // Context sets the context to be used in this call's Do method. Any
  3970. // pending HTTP request will be aborted if the provided context is
  3971. // canceled.
  3972. func (c *ProjectsJobsCancelCall) Context(ctx context.Context) *ProjectsJobsCancelCall {
  3973. c.ctx_ = ctx
  3974. return c
  3975. }
  3976. func (c *ProjectsJobsCancelCall) doRequest(alt string) (*http.Response, error) {
  3977. var body io.Reader = nil
  3978. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceljobrequest)
  3979. if err != nil {
  3980. return nil, err
  3981. }
  3982. ctype := "application/json"
  3983. c.urlParams_.Set("alt", alt)
  3984. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/jobs/{jobId}:cancel")
  3985. urls += "?" + c.urlParams_.Encode()
  3986. req, _ := http.NewRequest("POST", urls, body)
  3987. googleapi.Expand(req.URL, map[string]string{
  3988. "projectId": c.projectId,
  3989. "jobId": c.jobId,
  3990. })
  3991. req.Header.Set("Content-Type", ctype)
  3992. req.Header.Set("User-Agent", c.s.userAgent())
  3993. if c.ctx_ != nil {
  3994. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3995. }
  3996. return c.s.client.Do(req)
  3997. }
  3998. // Do executes the "dataproc.projects.jobs.cancel" call.
  3999. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  4000. // is an error. Response headers are in either
  4001. // *Job.ServerResponse.Header or (if a response was returned at all) in
  4002. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4003. // whether the returned error was because http.StatusNotModified was
  4004. // returned.
  4005. func (c *ProjectsJobsCancelCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  4006. gensupport.SetOptions(c.urlParams_, opts...)
  4007. res, err := c.doRequest("json")
  4008. if res != nil && res.StatusCode == http.StatusNotModified {
  4009. if res.Body != nil {
  4010. res.Body.Close()
  4011. }
  4012. return nil, &googleapi.Error{
  4013. Code: res.StatusCode,
  4014. Header: res.Header,
  4015. }
  4016. }
  4017. if err != nil {
  4018. return nil, err
  4019. }
  4020. defer googleapi.CloseBody(res)
  4021. if err := googleapi.CheckResponse(res); err != nil {
  4022. return nil, err
  4023. }
  4024. ret := &Job{
  4025. ServerResponse: googleapi.ServerResponse{
  4026. Header: res.Header,
  4027. HTTPStatusCode: res.StatusCode,
  4028. },
  4029. }
  4030. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4031. return nil, err
  4032. }
  4033. return ret, nil
  4034. // {
  4035. // "description": "Starts a job cancellation request. To access the job resource after cancellation, call jobs:list or jobs:get.",
  4036. // "httpMethod": "POST",
  4037. // "id": "dataproc.projects.jobs.cancel",
  4038. // "parameterOrder": [
  4039. // "projectId",
  4040. // "jobId"
  4041. // ],
  4042. // "parameters": {
  4043. // "jobId": {
  4044. // "description": "[Required] The job ID.",
  4045. // "location": "path",
  4046. // "required": true,
  4047. // "type": "string"
  4048. // },
  4049. // "projectId": {
  4050. // "description": "[Required] The ID of the Google Cloud Platform project that the job belongs to.",
  4051. // "location": "path",
  4052. // "required": true,
  4053. // "type": "string"
  4054. // }
  4055. // },
  4056. // "path": "v1alpha1/projects/{projectId}/jobs/{jobId}:cancel",
  4057. // "request": {
  4058. // "$ref": "CancelJobRequest"
  4059. // },
  4060. // "response": {
  4061. // "$ref": "Job"
  4062. // },
  4063. // "scopes": [
  4064. // "https://www.googleapis.com/auth/cloud-platform"
  4065. // ]
  4066. // }
  4067. }
  4068. // method id "dataproc.projects.jobs.delete":
  4069. type ProjectsJobsDeleteCall struct {
  4070. s *Service
  4071. projectId string
  4072. jobId string
  4073. urlParams_ gensupport.URLParams
  4074. ctx_ context.Context
  4075. }
  4076. // Delete: Deletes the job from the project. If the job is active, the
  4077. // delete fails, and the response returns `FAILED_PRECONDITION`.
  4078. func (r *ProjectsJobsService) Delete(projectId string, jobId string) *ProjectsJobsDeleteCall {
  4079. c := &ProjectsJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4080. c.projectId = projectId
  4081. c.jobId = jobId
  4082. return c
  4083. }
  4084. // Fields allows partial responses to be retrieved. See
  4085. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4086. // for more information.
  4087. func (c *ProjectsJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsJobsDeleteCall {
  4088. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4089. return c
  4090. }
  4091. // Context sets the context to be used in this call's Do method. Any
  4092. // pending HTTP request will be aborted if the provided context is
  4093. // canceled.
  4094. func (c *ProjectsJobsDeleteCall) Context(ctx context.Context) *ProjectsJobsDeleteCall {
  4095. c.ctx_ = ctx
  4096. return c
  4097. }
  4098. func (c *ProjectsJobsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4099. var body io.Reader = nil
  4100. c.urlParams_.Set("alt", alt)
  4101. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/jobs/{jobId}")
  4102. urls += "?" + c.urlParams_.Encode()
  4103. req, _ := http.NewRequest("DELETE", urls, body)
  4104. googleapi.Expand(req.URL, map[string]string{
  4105. "projectId": c.projectId,
  4106. "jobId": c.jobId,
  4107. })
  4108. req.Header.Set("User-Agent", c.s.userAgent())
  4109. if c.ctx_ != nil {
  4110. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4111. }
  4112. return c.s.client.Do(req)
  4113. }
  4114. // Do executes the "dataproc.projects.jobs.delete" call.
  4115. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  4116. // is an error. Response headers are in either
  4117. // *Job.ServerResponse.Header or (if a response was returned at all) in
  4118. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4119. // whether the returned error was because http.StatusNotModified was
  4120. // returned.
  4121. func (c *ProjectsJobsDeleteCall) Do(opts ...googleapi.CallOption) (*Job, 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 := &Job{
  4141. ServerResponse: googleapi.ServerResponse{
  4142. Header: res.Header,
  4143. HTTPStatusCode: res.StatusCode,
  4144. },
  4145. }
  4146. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4147. return nil, err
  4148. }
  4149. return ret, nil
  4150. // {
  4151. // "description": "Deletes the job from the project. If the job is active, the delete fails, and the response returns `FAILED_PRECONDITION`.",
  4152. // "httpMethod": "DELETE",
  4153. // "id": "dataproc.projects.jobs.delete",
  4154. // "parameterOrder": [
  4155. // "projectId",
  4156. // "jobId"
  4157. // ],
  4158. // "parameters": {
  4159. // "jobId": {
  4160. // "description": "[Required] The job ID.",
  4161. // "location": "path",
  4162. // "required": true,
  4163. // "type": "string"
  4164. // },
  4165. // "projectId": {
  4166. // "description": "[Required] The ID of the Google Cloud Platform project that the job belongs to.",
  4167. // "location": "path",
  4168. // "required": true,
  4169. // "type": "string"
  4170. // }
  4171. // },
  4172. // "path": "v1alpha1/projects/{projectId}/jobs/{jobId}",
  4173. // "response": {
  4174. // "$ref": "Job"
  4175. // },
  4176. // "scopes": [
  4177. // "https://www.googleapis.com/auth/cloud-platform"
  4178. // ]
  4179. // }
  4180. }
  4181. // method id "dataproc.projects.jobs.get":
  4182. type ProjectsJobsGetCall struct {
  4183. s *Service
  4184. projectId string
  4185. jobId string
  4186. urlParams_ gensupport.URLParams
  4187. ifNoneMatch_ string
  4188. ctx_ context.Context
  4189. }
  4190. // Get: Gets the resource representation for a job in a project.
  4191. func (r *ProjectsJobsService) Get(projectId string, jobId string) *ProjectsJobsGetCall {
  4192. c := &ProjectsJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4193. c.projectId = projectId
  4194. c.jobId = jobId
  4195. return c
  4196. }
  4197. // Fields allows partial responses to be retrieved. See
  4198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4199. // for more information.
  4200. func (c *ProjectsJobsGetCall) Fields(s ...googleapi.Field) *ProjectsJobsGetCall {
  4201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4202. return c
  4203. }
  4204. // IfNoneMatch sets the optional parameter which makes the operation
  4205. // fail if the object's ETag matches the given value. This is useful for
  4206. // getting updates only after the object has changed since the last
  4207. // request. Use googleapi.IsNotModified to check whether the response
  4208. // error from Do is the result of In-None-Match.
  4209. func (c *ProjectsJobsGetCall) IfNoneMatch(entityTag string) *ProjectsJobsGetCall {
  4210. c.ifNoneMatch_ = entityTag
  4211. return c
  4212. }
  4213. // Context sets the context to be used in this call's Do method. Any
  4214. // pending HTTP request will be aborted if the provided context is
  4215. // canceled.
  4216. func (c *ProjectsJobsGetCall) Context(ctx context.Context) *ProjectsJobsGetCall {
  4217. c.ctx_ = ctx
  4218. return c
  4219. }
  4220. func (c *ProjectsJobsGetCall) doRequest(alt string) (*http.Response, error) {
  4221. var body io.Reader = nil
  4222. c.urlParams_.Set("alt", alt)
  4223. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/jobs/{jobId}")
  4224. urls += "?" + c.urlParams_.Encode()
  4225. req, _ := http.NewRequest("GET", urls, body)
  4226. googleapi.Expand(req.URL, map[string]string{
  4227. "projectId": c.projectId,
  4228. "jobId": c.jobId,
  4229. })
  4230. req.Header.Set("User-Agent", c.s.userAgent())
  4231. if c.ifNoneMatch_ != "" {
  4232. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4233. }
  4234. if c.ctx_ != nil {
  4235. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4236. }
  4237. return c.s.client.Do(req)
  4238. }
  4239. // Do executes the "dataproc.projects.jobs.get" call.
  4240. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  4241. // is an error. Response headers are in either
  4242. // *Job.ServerResponse.Header or (if a response was returned at all) in
  4243. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4244. // whether the returned error was because http.StatusNotModified was
  4245. // returned.
  4246. func (c *ProjectsJobsGetCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  4247. gensupport.SetOptions(c.urlParams_, opts...)
  4248. res, err := c.doRequest("json")
  4249. if res != nil && res.StatusCode == http.StatusNotModified {
  4250. if res.Body != nil {
  4251. res.Body.Close()
  4252. }
  4253. return nil, &googleapi.Error{
  4254. Code: res.StatusCode,
  4255. Header: res.Header,
  4256. }
  4257. }
  4258. if err != nil {
  4259. return nil, err
  4260. }
  4261. defer googleapi.CloseBody(res)
  4262. if err := googleapi.CheckResponse(res); err != nil {
  4263. return nil, err
  4264. }
  4265. ret := &Job{
  4266. ServerResponse: googleapi.ServerResponse{
  4267. Header: res.Header,
  4268. HTTPStatusCode: res.StatusCode,
  4269. },
  4270. }
  4271. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4272. return nil, err
  4273. }
  4274. return ret, nil
  4275. // {
  4276. // "description": "Gets the resource representation for a job in a project.",
  4277. // "httpMethod": "GET",
  4278. // "id": "dataproc.projects.jobs.get",
  4279. // "parameterOrder": [
  4280. // "projectId",
  4281. // "jobId"
  4282. // ],
  4283. // "parameters": {
  4284. // "jobId": {
  4285. // "description": "[Required] The job ID.",
  4286. // "location": "path",
  4287. // "required": true,
  4288. // "type": "string"
  4289. // },
  4290. // "projectId": {
  4291. // "description": "[Required] The ID of the Google Cloud Platform project that the job belongs to.",
  4292. // "location": "path",
  4293. // "required": true,
  4294. // "type": "string"
  4295. // }
  4296. // },
  4297. // "path": "v1alpha1/projects/{projectId}/jobs/{jobId}",
  4298. // "response": {
  4299. // "$ref": "Job"
  4300. // },
  4301. // "scopes": [
  4302. // "https://www.googleapis.com/auth/cloud-platform"
  4303. // ]
  4304. // }
  4305. }
  4306. // method id "dataproc.projects.jobs.submit":
  4307. type ProjectsJobsSubmitCall struct {
  4308. s *Service
  4309. projectId string
  4310. submitjobrequest *SubmitJobRequest
  4311. urlParams_ gensupport.URLParams
  4312. ctx_ context.Context
  4313. }
  4314. // Submit: Submits a job to a cluster.
  4315. func (r *ProjectsJobsService) Submit(projectId string, submitjobrequest *SubmitJobRequest) *ProjectsJobsSubmitCall {
  4316. c := &ProjectsJobsSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4317. c.projectId = projectId
  4318. c.submitjobrequest = submitjobrequest
  4319. return c
  4320. }
  4321. // Fields allows partial responses to be retrieved. See
  4322. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4323. // for more information.
  4324. func (c *ProjectsJobsSubmitCall) Fields(s ...googleapi.Field) *ProjectsJobsSubmitCall {
  4325. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4326. return c
  4327. }
  4328. // Context sets the context to be used in this call's Do method. Any
  4329. // pending HTTP request will be aborted if the provided context is
  4330. // canceled.
  4331. func (c *ProjectsJobsSubmitCall) Context(ctx context.Context) *ProjectsJobsSubmitCall {
  4332. c.ctx_ = ctx
  4333. return c
  4334. }
  4335. func (c *ProjectsJobsSubmitCall) doRequest(alt string) (*http.Response, error) {
  4336. var body io.Reader = nil
  4337. body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitjobrequest)
  4338. if err != nil {
  4339. return nil, err
  4340. }
  4341. ctype := "application/json"
  4342. c.urlParams_.Set("alt", alt)
  4343. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/projects/{projectId}/jobs:submit")
  4344. urls += "?" + c.urlParams_.Encode()
  4345. req, _ := http.NewRequest("POST", urls, body)
  4346. googleapi.Expand(req.URL, map[string]string{
  4347. "projectId": c.projectId,
  4348. })
  4349. req.Header.Set("Content-Type", ctype)
  4350. req.Header.Set("User-Agent", c.s.userAgent())
  4351. if c.ctx_ != nil {
  4352. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4353. }
  4354. return c.s.client.Do(req)
  4355. }
  4356. // Do executes the "dataproc.projects.jobs.submit" call.
  4357. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  4358. // is an error. Response headers are in either
  4359. // *Job.ServerResponse.Header or (if a response was returned at all) in
  4360. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4361. // whether the returned error was because http.StatusNotModified was
  4362. // returned.
  4363. func (c *ProjectsJobsSubmitCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  4364. gensupport.SetOptions(c.urlParams_, opts...)
  4365. res, err := c.doRequest("json")
  4366. if res != nil && res.StatusCode == http.StatusNotModified {
  4367. if res.Body != nil {
  4368. res.Body.Close()
  4369. }
  4370. return nil, &googleapi.Error{
  4371. Code: res.StatusCode,
  4372. Header: res.Header,
  4373. }
  4374. }
  4375. if err != nil {
  4376. return nil, err
  4377. }
  4378. defer googleapi.CloseBody(res)
  4379. if err := googleapi.CheckResponse(res); err != nil {
  4380. return nil, err
  4381. }
  4382. ret := &Job{
  4383. ServerResponse: googleapi.ServerResponse{
  4384. Header: res.Header,
  4385. HTTPStatusCode: res.StatusCode,
  4386. },
  4387. }
  4388. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4389. return nil, err
  4390. }
  4391. return ret, nil
  4392. // {
  4393. // "description": "Submits a job to a cluster.",
  4394. // "httpMethod": "POST",
  4395. // "id": "dataproc.projects.jobs.submit",
  4396. // "parameterOrder": [
  4397. // "projectId"
  4398. // ],
  4399. // "parameters": {
  4400. // "projectId": {
  4401. // "description": "[Required] The ID of the Google Cloud Platform project that the job belongs to.",
  4402. // "location": "path",
  4403. // "required": true,
  4404. // "type": "string"
  4405. // }
  4406. // },
  4407. // "path": "v1alpha1/projects/{projectId}/jobs:submit",
  4408. // "request": {
  4409. // "$ref": "SubmitJobRequest"
  4410. // },
  4411. // "response": {
  4412. // "$ref": "Job"
  4413. // },
  4414. // "scopes": [
  4415. // "https://www.googleapis.com/auth/cloud-platform"
  4416. // ]
  4417. // }
  4418. }