dataproc-gen.go 122 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504
  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/v1beta1"
  8. // ...
  9. // dataprocService, err := dataproc.New(oauthHttpClient)
  10. package dataproc // import "google.golang.org/api/dataproc/v1beta1"
  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:v1beta1"
  41. const apiName = "dataproc"
  42. const apiVersion = "v1beta1"
  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. )
  49. func New(client *http.Client) (*Service, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &Service{client: client, BasePath: basePath}
  54. s.Operations = NewOperationsService(s)
  55. s.Projects = NewProjectsService(s)
  56. return s, nil
  57. }
  58. type Service struct {
  59. client *http.Client
  60. BasePath string // API endpoint base URL
  61. UserAgent string // optional additional User-Agent fragment
  62. Operations *OperationsService
  63. Projects *ProjectsService
  64. }
  65. func (s *Service) userAgent() string {
  66. if s.UserAgent == "" {
  67. return googleapi.UserAgent
  68. }
  69. return googleapi.UserAgent + " " + s.UserAgent
  70. }
  71. func NewOperationsService(s *Service) *OperationsService {
  72. rs := &OperationsService{s: s}
  73. return rs
  74. }
  75. type OperationsService struct {
  76. s *Service
  77. }
  78. func NewProjectsService(s *Service) *ProjectsService {
  79. rs := &ProjectsService{s: s}
  80. rs.Clusters = NewProjectsClustersService(s)
  81. rs.Jobs = NewProjectsJobsService(s)
  82. return rs
  83. }
  84. type ProjectsService struct {
  85. s *Service
  86. Clusters *ProjectsClustersService
  87. Jobs *ProjectsJobsService
  88. }
  89. func NewProjectsClustersService(s *Service) *ProjectsClustersService {
  90. rs := &ProjectsClustersService{s: s}
  91. return rs
  92. }
  93. type ProjectsClustersService struct {
  94. s *Service
  95. }
  96. func NewProjectsJobsService(s *Service) *ProjectsJobsService {
  97. rs := &ProjectsJobsService{s: s}
  98. return rs
  99. }
  100. type ProjectsJobsService struct {
  101. s *Service
  102. }
  103. // CancelJobRequest: A request to cancel a job.
  104. type CancelJobRequest struct {
  105. }
  106. // CancelOperationRequest: The request message for
  107. // Operations.CancelOperation.
  108. type CancelOperationRequest struct {
  109. }
  110. // Cluster: Describes the identifying information, configuration, and
  111. // status of a cluster of Google Compute Engine instances.
  112. type Cluster struct {
  113. // ClusterName: [Required] The cluster name. Cluster names within a
  114. // project must be unique. Names from deleted clusters can be reused.
  115. ClusterName string `json:"clusterName,omitempty"`
  116. // ClusterUuid: [Output-only] A cluster UUID (Unique Universal
  117. // Identifier). Cloud Dataproc generates this value when it creates the
  118. // cluster.
  119. ClusterUuid string `json:"clusterUuid,omitempty"`
  120. // Configuration: [Required] The cluster configuration. Note that Cloud
  121. // Dataproc may set default values, and values may change when clusters
  122. // are updated.
  123. Configuration *ClusterConfiguration `json:"configuration,omitempty"`
  124. // ProjectId: [Required] The Google Cloud Platform project ID that the
  125. // cluster belongs to.
  126. ProjectId string `json:"projectId,omitempty"`
  127. // Status: [Output-only] Cluster status.
  128. Status *ClusterStatus `json:"status,omitempty"`
  129. // StatusHistory: [Output-only] Previous cluster statuses.
  130. StatusHistory []*ClusterStatus `json:"statusHistory,omitempty"`
  131. // ServerResponse contains the HTTP response code and headers from the
  132. // server.
  133. googleapi.ServerResponse `json:"-"`
  134. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  135. // unconditionally include in API requests. By default, fields with
  136. // empty values are omitted from API requests. However, any non-pointer,
  137. // non-interface field appearing in ForceSendFields will be sent to the
  138. // server regardless of whether the field is empty or not. This may be
  139. // used to include empty fields in Patch requests.
  140. ForceSendFields []string `json:"-"`
  141. }
  142. func (s *Cluster) MarshalJSON() ([]byte, error) {
  143. type noMethod Cluster
  144. raw := noMethod(*s)
  145. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  146. }
  147. // ClusterConfiguration: The cluster configuration.
  148. type ClusterConfiguration struct {
  149. // ConfigurationBucket: [Optional] A Google Cloud Storage staging bucket
  150. // used for sharing generated SSH keys and configuration. If you do not
  151. // specify a staging bucket, Cloud Dataproc will determine an
  152. // appropriate Cloud Storage location (US, ASIA, or EU) for your
  153. // cluster's staging bucket according to the Google Compute Engine zone
  154. // where your cluster is deployed, and then it will create and manage
  155. // this project-level, per-location bucket for you.
  156. ConfigurationBucket string `json:"configurationBucket,omitempty"`
  157. // GceClusterConfiguration: [Optional] The shared Google Compute Engine
  158. // configuration settings for all instances in a cluster.
  159. GceClusterConfiguration *GceClusterConfiguration `json:"gceClusterConfiguration,omitempty"`
  160. // InitializationActions: [Optional] Commands to execute on each node
  161. // after configuration is completed. By default, executables are run on
  162. // master and all worker nodes. You can test a node's role metadata to
  163. // run an executable on a master or worker node, as shown below:
  164. // ROLE=$(/usr/share/google/get_metadata_value attributes/role) if [[
  165. // "${ROLE}" == 'Master' ]]; then ... master specific actions ... else
  166. // ... worker specific actions ... fi
  167. InitializationActions []*NodeInitializationAction `json:"initializationActions,omitempty"`
  168. // MasterConfiguration: [Optional] The Google Compute Engine
  169. // configuration settings for the master instance in a cluster.
  170. MasterConfiguration *InstanceGroupConfiguration `json:"masterConfiguration,omitempty"`
  171. // SecondaryWorkerConfiguration: [Optional] The Google Compute Engine
  172. // configuration settings for additional worker instances in a cluster.
  173. SecondaryWorkerConfiguration *InstanceGroupConfiguration `json:"secondaryWorkerConfiguration,omitempty"`
  174. // SoftwareConfiguration: [Optional] The configuration settings for
  175. // software inside the cluster.
  176. SoftwareConfiguration *SoftwareConfiguration `json:"softwareConfiguration,omitempty"`
  177. // WorkerConfiguration: [Optional] The Google Compute Engine
  178. // configuration settings for worker instances in a cluster.
  179. WorkerConfiguration *InstanceGroupConfiguration `json:"workerConfiguration,omitempty"`
  180. // ForceSendFields is a list of field names (e.g. "ConfigurationBucket")
  181. // to unconditionally include in API requests. By default, fields with
  182. // empty values are omitted from API requests. However, any non-pointer,
  183. // non-interface field appearing in ForceSendFields will be sent to the
  184. // server regardless of whether the field is empty or not. This may be
  185. // used to include empty fields in Patch requests.
  186. ForceSendFields []string `json:"-"`
  187. }
  188. func (s *ClusterConfiguration) MarshalJSON() ([]byte, error) {
  189. type noMethod ClusterConfiguration
  190. raw := noMethod(*s)
  191. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  192. }
  193. // ClusterStatus: The status of a cluster and its instances.
  194. type ClusterStatus struct {
  195. // Detail: Optional details of cluster's state.
  196. Detail string `json:"detail,omitempty"`
  197. // State: The cluster's state.
  198. //
  199. // Possible values:
  200. // "UNKNOWN"
  201. // "CREATING"
  202. // "RUNNING"
  203. // "ERROR"
  204. // "DELETING"
  205. // "UPDATING"
  206. State string `json:"state,omitempty"`
  207. // StateStartTime: Time when this state was entered.
  208. StateStartTime string `json:"stateStartTime,omitempty"`
  209. // ForceSendFields is a list of field names (e.g. "Detail") to
  210. // unconditionally include in API requests. By default, fields with
  211. // empty values are omitted from API requests. However, any non-pointer,
  212. // non-interface field appearing in ForceSendFields will be sent to the
  213. // server regardless of whether the field is empty or not. This may be
  214. // used to include empty fields in Patch requests.
  215. ForceSendFields []string `json:"-"`
  216. }
  217. func (s *ClusterStatus) MarshalJSON() ([]byte, error) {
  218. type noMethod ClusterStatus
  219. raw := noMethod(*s)
  220. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  221. }
  222. // DiagnoseClusterOutputLocation: The location where output from
  223. // diagnostic command can be found.
  224. type DiagnoseClusterOutputLocation struct {
  225. // OutputUri: [Output-only] The Google Cloud Storage URI of the
  226. // diagnostic output. This will be a plain text file with summary of
  227. // collected diagnostics.
  228. OutputUri string `json:"outputUri,omitempty"`
  229. // ForceSendFields is a list of field names (e.g. "OutputUri") to
  230. // unconditionally include in API requests. By default, fields with
  231. // empty values are omitted from API requests. However, any non-pointer,
  232. // non-interface field appearing in ForceSendFields will be sent to the
  233. // server regardless of whether the field is empty or not. This may be
  234. // used to include empty fields in Patch requests.
  235. ForceSendFields []string `json:"-"`
  236. }
  237. func (s *DiagnoseClusterOutputLocation) MarshalJSON() ([]byte, error) {
  238. type noMethod DiagnoseClusterOutputLocation
  239. raw := noMethod(*s)
  240. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  241. }
  242. // DiagnoseClusterRequest: A request to collect cluster diagnostic
  243. // information.
  244. type DiagnoseClusterRequest struct {
  245. }
  246. // DiskConfiguration: Specifies the configuration of disk options for a
  247. // group of VM instances.
  248. type DiskConfiguration struct {
  249. // BootDiskSizeGb: [Optional] Size in GB of the boot disk (default is
  250. // 500GB).
  251. BootDiskSizeGb int64 `json:"bootDiskSizeGb,omitempty"`
  252. // NumLocalSsds: [Optional] Number of attached SSDs, from 0 to 4
  253. // (default is 0). If SSDs are not attached, the boot disk is used to
  254. // store runtime logs and HDFS data. If one or more SSDs are attached,
  255. // this runtime bulk data is spread across them, and the boot disk
  256. // contains only basic configuration and installed binaries.
  257. NumLocalSsds int64 `json:"numLocalSsds,omitempty"`
  258. // ForceSendFields is a list of field names (e.g. "BootDiskSizeGb") to
  259. // unconditionally include in API requests. By default, fields with
  260. // empty values are omitted from API requests. However, any non-pointer,
  261. // non-interface field appearing in ForceSendFields will be sent to the
  262. // server regardless of whether the field is empty or not. This may be
  263. // used to include empty fields in Patch requests.
  264. ForceSendFields []string `json:"-"`
  265. }
  266. func (s *DiskConfiguration) MarshalJSON() ([]byte, error) {
  267. type noMethod DiskConfiguration
  268. raw := noMethod(*s)
  269. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  270. }
  271. // Empty: A generic empty message that you can re-use to avoid defining
  272. // duplicated empty messages in your APIs. A typical example is to use
  273. // it as the request or the response type of an API method. For
  274. // instance: service Foo { rpc Bar(google.protobuf.Empty) returns
  275. // (google.protobuf.Empty); } The JSON representation for `Empty` is
  276. // empty JSON object `{}`.
  277. type Empty struct {
  278. // ServerResponse contains the HTTP response code and headers from the
  279. // server.
  280. googleapi.ServerResponse `json:"-"`
  281. }
  282. // GceClusterConfiguration: Common configuration settings for resources
  283. // of Google Compute Engine cluster instances, applicable to all
  284. // instances in the cluster.
  285. type GceClusterConfiguration struct {
  286. // NetworkUri: The Google Compute Engine network to be used for machine
  287. // communications. Inbound SSH connections are necessary to complete
  288. // cluster configuration. Example:
  289. // `compute.googleapis.com/projects/[project_id]/zones/us-east1-a/default
  290. // `.
  291. NetworkUri string `json:"networkUri,omitempty"`
  292. // ServiceAccountScopes: The URIs of service account scopes to be
  293. // included in Google Compute Engine instances. The following base set
  294. // of scopes is always included: -
  295. // https://www.googleapis.com/auth/cloud.useraccounts.readonly -
  296. // https://www.googleapis.com/auth/devstorage.read_write -
  297. // https://www.googleapis.com/auth/logging.write If no scopes are
  298. // specfied, the following defaults are also provided: -
  299. // https://www.googleapis.com/auth/bigquery -
  300. // https://www.googleapis.com/auth/bigtable.admin.table -
  301. // https://www.googleapis.com/auth/bigtable.data -
  302. // https://www.googleapis.com/auth/devstorage.full_control
  303. ServiceAccountScopes []string `json:"serviceAccountScopes,omitempty"`
  304. // ZoneUri: [Required] The zone where the Google Compute Engine cluster
  305. // will be located. Example:
  306. // `compute.googleapis.com/projects/[project_id]/zones/us-east1-a`.
  307. ZoneUri string `json:"zoneUri,omitempty"`
  308. // ForceSendFields is a list of field names (e.g. "NetworkUri") to
  309. // unconditionally include in API requests. By default, fields with
  310. // empty values are omitted from API requests. However, any non-pointer,
  311. // non-interface field appearing in ForceSendFields will be sent to the
  312. // server regardless of whether the field is empty or not. This may be
  313. // used to include empty fields in Patch requests.
  314. ForceSendFields []string `json:"-"`
  315. }
  316. func (s *GceClusterConfiguration) MarshalJSON() ([]byte, error) {
  317. type noMethod GceClusterConfiguration
  318. raw := noMethod(*s)
  319. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  320. }
  321. // HadoopJob: A Cloud Dataproc job for running Hadoop MapReduce jobs on
  322. // YARN.
  323. type HadoopJob struct {
  324. // ArchiveUris: [Optional] HCFS URIs of archives to be extracted in the
  325. // working directory of Hadoop drivers and tasks. Supported file types:
  326. // .jar, .tar, .tar.gz, .tgz, or .zip.
  327. ArchiveUris []string `json:"archiveUris,omitempty"`
  328. // Args: [Optional] The arguments to pass to the driver. Do not include
  329. // arguments, such as `-libjars` or `-Dfoo=bar`, that can be set as job
  330. // properties, since a collision may occur that causes an incorrect job
  331. // submission.
  332. Args []string `json:"args,omitempty"`
  333. // FileUris: [Optional] HCFS URIs of files to be copied to the working
  334. // directory of Hadoop drivers and distributed tasks. Useful for naively
  335. // parallel tasks.
  336. FileUris []string `json:"fileUris,omitempty"`
  337. // JarFileUris: [Optional] Jar file URIs to add to the CLASSPATHs of the
  338. // Hadoop driver and tasks.
  339. JarFileUris []string `json:"jarFileUris,omitempty"`
  340. // LoggingConfiguration: [Optional] The runtime log configuration for
  341. // job execution.
  342. LoggingConfiguration *LoggingConfiguration `json:"loggingConfiguration,omitempty"`
  343. // MainClass: The name of the driver's main class. The jar file
  344. // containing the class must be in the default CLASSPATH or specified in
  345. // `jar_file_uris`.
  346. MainClass string `json:"mainClass,omitempty"`
  347. // MainJarFileUri: The Hadoop Compatible Filesystem (HCFS) URI of the
  348. // jar file containing the main class. Examples:
  349. // 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar'
  350. // 'hdfs:/tmp/test-samples/custom-wordcount.jar'
  351. // 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar'
  352. MainJarFileUri string `json:"mainJarFileUri,omitempty"`
  353. // Properties: [Optional] A mapping of property names to values, used to
  354. // configure Hadoop. Properties that conflict with values set by the
  355. // Cloud Dataproc API may be overwritten. Can include properties set in
  356. // /etc/hadoop/conf/*-site and classes in user code.
  357. Properties map[string]string `json:"properties,omitempty"`
  358. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  359. // unconditionally include in API requests. By default, fields with
  360. // empty values are omitted from API requests. However, any non-pointer,
  361. // non-interface field appearing in ForceSendFields will be sent to the
  362. // server regardless of whether the field is empty or not. This may be
  363. // used to include empty fields in Patch requests.
  364. ForceSendFields []string `json:"-"`
  365. }
  366. func (s *HadoopJob) MarshalJSON() ([]byte, error) {
  367. type noMethod HadoopJob
  368. raw := noMethod(*s)
  369. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  370. }
  371. // HiveJob: A Cloud Dataproc job for running Hive queries on YARN.
  372. type HiveJob struct {
  373. // ContinueOnFailure: [Optional] Whether to continue executing queries
  374. // if a query fails. The default value is `false`. Setting to `true` can
  375. // be useful when executing independent parallel queries.
  376. ContinueOnFailure bool `json:"continueOnFailure,omitempty"`
  377. // JarFileUris: [Optional] HCFS URIs of jar files to add to the
  378. // CLASSPATH of the Hive server and Hadoop MapReduce (MR) tasks. Can
  379. // contain Hive SerDes and UDFs.
  380. JarFileUris []string `json:"jarFileUris,omitempty"`
  381. // Properties: [Optional] A mapping of property names and values, used
  382. // to configure Hive. Properties that conflict with values set by the
  383. // Cloud Dataproc API may be overwritten. Can include properties set in
  384. // /etc/hadoop/conf/*-site.xml, /etc/hive/conf/hive-site.xml, and
  385. // classes in user code.
  386. Properties map[string]string `json:"properties,omitempty"`
  387. // QueryFileUri: The HCFS URI of the script that contains Hive queries.
  388. QueryFileUri string `json:"queryFileUri,omitempty"`
  389. // QueryList: A list of queries.
  390. QueryList *QueryList `json:"queryList,omitempty"`
  391. // ScriptVariables: [Optional] Mapping of query variable names to values
  392. // (equivalent to the Hive command: `SET name="value";`).
  393. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  394. // ForceSendFields is a list of field names (e.g. "ContinueOnFailure")
  395. // to unconditionally include in API requests. By default, fields with
  396. // empty values are omitted from API requests. However, any non-pointer,
  397. // non-interface field appearing in ForceSendFields will be sent to the
  398. // server regardless of whether the field is empty or not. This may be
  399. // used to include empty fields in Patch requests.
  400. ForceSendFields []string `json:"-"`
  401. }
  402. func (s *HiveJob) MarshalJSON() ([]byte, error) {
  403. type noMethod HiveJob
  404. raw := noMethod(*s)
  405. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  406. }
  407. // InstanceGroupConfiguration: The configuration settings for Google
  408. // Compute Engine resources in an instance group, such as a master or
  409. // worker group.
  410. type InstanceGroupConfiguration struct {
  411. // DiskConfiguration: Disk option configuration settings.
  412. DiskConfiguration *DiskConfiguration `json:"diskConfiguration,omitempty"`
  413. // ImageUri: [Output-only] The Google Compute Engine image resource used
  414. // for cluster instances. Inferred from
  415. // `SoftwareConfiguration.image_version`. Example:
  416. // `compute.googleapis.com/projects/debian-cloud/global/images/backports-
  417. // debian-7-wheezy-v20140904`.
  418. ImageUri string `json:"imageUri,omitempty"`
  419. // InstanceNames: The list of instance names. Dataproc derives the names
  420. // from `cluster_name`, `num_instances`, and the instance group if not
  421. // set by user (recommended practice is to let Dataproc derive the
  422. // name).
  423. InstanceNames []string `json:"instanceNames,omitempty"`
  424. // IsPreemptible: Specifies that this instance group contains
  425. // Preemptible Instances.
  426. IsPreemptible bool `json:"isPreemptible,omitempty"`
  427. // MachineTypeUri: The Google Compute Engine machine type used for
  428. // cluster instances. Example:
  429. // `compute.googleapis.com/projects/[project_id]/zones/us-east1-a/machine
  430. // Types/n1-standard-2`.
  431. MachineTypeUri string `json:"machineTypeUri,omitempty"`
  432. // ManagedGroupConfiguration: [Output-only] The configuration for Google
  433. // Compute Engine Instance Group Manager that manages this group. This
  434. // is only used for preemptible instance groups.
  435. ManagedGroupConfiguration *ManagedGroupConfiguration `json:"managedGroupConfiguration,omitempty"`
  436. // NumInstances: The number of VM instances in the instance group. For
  437. // master instance groups, must be set to 1.
  438. NumInstances int64 `json:"numInstances,omitempty"`
  439. // ForceSendFields is a list of field names (e.g. "DiskConfiguration")
  440. // to unconditionally include in API requests. By default, fields with
  441. // empty values are omitted from API requests. However, any non-pointer,
  442. // non-interface field appearing in ForceSendFields will be sent to the
  443. // server regardless of whether the field is empty or not. This may be
  444. // used to include empty fields in Patch requests.
  445. ForceSendFields []string `json:"-"`
  446. }
  447. func (s *InstanceGroupConfiguration) MarshalJSON() ([]byte, error) {
  448. type noMethod InstanceGroupConfiguration
  449. raw := noMethod(*s)
  450. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  451. }
  452. // Job: A Cloud Dataproc job resource.
  453. type Job struct {
  454. // DriverControlFilesUri: [Output-only] If present, the location of
  455. // miscellaneous control files which may be used as part of job setup
  456. // and handling. If not present, control files may be placed in the same
  457. // location as `driver_output_uri`.
  458. DriverControlFilesUri string `json:"driverControlFilesUri,omitempty"`
  459. // DriverInputResourceUri: [Output-only] A URI pointing to the location
  460. // of the stdin of the job's driver program, only set if the job is
  461. // interactive.
  462. DriverInputResourceUri string `json:"driverInputResourceUri,omitempty"`
  463. // DriverOutputResourceUri: [Output-only] A URI pointing to the location
  464. // of the stdout of the job's driver program.
  465. DriverOutputResourceUri string `json:"driverOutputResourceUri,omitempty"`
  466. // HadoopJob: Job is a Hadoop job.
  467. HadoopJob *HadoopJob `json:"hadoopJob,omitempty"`
  468. // HiveJob: Job is a Hive job.
  469. HiveJob *HiveJob `json:"hiveJob,omitempty"`
  470. // Interactive: [Optional] If set to `true`, the driver's stdin will be
  471. // kept open and `driver_input_uri` will be set to provide a path at
  472. // which additional input can be sent to the driver.
  473. Interactive bool `json:"interactive,omitempty"`
  474. // PigJob: Job is a Pig job.
  475. PigJob *PigJob `json:"pigJob,omitempty"`
  476. // Placement: [Required] Job information, including how, when, and where
  477. // to run the job.
  478. Placement *JobPlacement `json:"placement,omitempty"`
  479. // PysparkJob: Job is a Pyspark job.
  480. PysparkJob *PySparkJob `json:"pysparkJob,omitempty"`
  481. // Reference: [Optional] The fully qualified reference to the job, which
  482. // can be used to obtain the equivalent REST path of the job resource.
  483. // If this property is not specified when a job is created, the server
  484. // generates a job_id.
  485. Reference *JobReference `json:"reference,omitempty"`
  486. // SparkJob: Job is a Spark job.
  487. SparkJob *SparkJob `json:"sparkJob,omitempty"`
  488. // SparkSqlJob: Job is a SparkSql job.
  489. SparkSqlJob *SparkSqlJob `json:"sparkSqlJob,omitempty"`
  490. // Status: [Output-only] The job status. Additional application-specific
  491. // status information may be contained in the type_job and
  492. // yarn_applications fields.
  493. Status *JobStatus `json:"status,omitempty"`
  494. // StatusHistory: [Output-only] The previous job status.
  495. StatusHistory []*JobStatus `json:"statusHistory,omitempty"`
  496. // SubmittedBy: [Output-only] The email address of the user submitting
  497. // the job. For jobs submitted on the cluster, the address is
  498. // username@hostname.
  499. SubmittedBy string `json:"submittedBy,omitempty"`
  500. // YarnApplications: [Output-only] The collection of YARN applications
  501. // spun up by this job.
  502. YarnApplications []*YarnApplication `json:"yarnApplications,omitempty"`
  503. // ServerResponse contains the HTTP response code and headers from the
  504. // server.
  505. googleapi.ServerResponse `json:"-"`
  506. // ForceSendFields is a list of field names (e.g.
  507. // "DriverControlFilesUri") to unconditionally include in API requests.
  508. // By default, fields with empty values are omitted from API requests.
  509. // However, any non-pointer, non-interface field appearing in
  510. // ForceSendFields will be sent to the server regardless of whether the
  511. // field is empty or not. This may be used to include empty fields in
  512. // Patch requests.
  513. ForceSendFields []string `json:"-"`
  514. }
  515. func (s *Job) MarshalJSON() ([]byte, error) {
  516. type noMethod Job
  517. raw := noMethod(*s)
  518. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  519. }
  520. // JobPlacement: Cloud Dataproc job configuration.
  521. type JobPlacement struct {
  522. // ClusterName: [Required] The name of the cluster where the job will be
  523. // submitted.
  524. ClusterName string `json:"clusterName,omitempty"`
  525. // ClusterUuid: [Output-only] A cluster UUID generated by the Dataproc
  526. // service when the job is submitted.
  527. ClusterUuid string `json:"clusterUuid,omitempty"`
  528. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  529. // unconditionally include in API requests. By default, fields with
  530. // empty values are omitted from API requests. However, any non-pointer,
  531. // non-interface field appearing in ForceSendFields will be sent to the
  532. // server regardless of whether the field is empty or not. This may be
  533. // used to include empty fields in Patch requests.
  534. ForceSendFields []string `json:"-"`
  535. }
  536. func (s *JobPlacement) MarshalJSON() ([]byte, error) {
  537. type noMethod JobPlacement
  538. raw := noMethod(*s)
  539. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  540. }
  541. // JobReference: Encapsulates the full scoping used to reference a job.
  542. type JobReference struct {
  543. // JobId: [Required] The job ID, which must be unique within the
  544. // project. The job ID is generated by the server upon job submission or
  545. // provided by the user as a means to perform retries without creating
  546. // duplicate jobs. The ID must contain only letters (a-z, A-Z), numbers
  547. // (0-9), underscores (_), or hyphens (-). The maximum length is 512
  548. // characters.
  549. JobId string `json:"jobId,omitempty"`
  550. // ProjectId: [Required] The ID of the Google Cloud Platform project
  551. // that the job belongs to.
  552. ProjectId string `json:"projectId,omitempty"`
  553. // ForceSendFields is a list of field names (e.g. "JobId") to
  554. // unconditionally include in API requests. By default, fields with
  555. // empty values are omitted from API requests. However, any non-pointer,
  556. // non-interface field appearing in ForceSendFields will be sent to the
  557. // server regardless of whether the field is empty or not. This may be
  558. // used to include empty fields in Patch requests.
  559. ForceSendFields []string `json:"-"`
  560. }
  561. func (s *JobReference) MarshalJSON() ([]byte, error) {
  562. type noMethod JobReference
  563. raw := noMethod(*s)
  564. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  565. }
  566. // JobStatus: Cloud Dataproc job status.
  567. type JobStatus struct {
  568. // Details: [Optional] Job state details, such as an error description
  569. // if the state is ERROR.
  570. Details string `json:"details,omitempty"`
  571. // State: [Required] A state message specifying the overall job state.
  572. //
  573. // Possible values:
  574. // "STATE_UNSPECIFIED"
  575. // "PENDING"
  576. // "SETUP_DONE"
  577. // "RUNNING"
  578. // "CANCEL_PENDING"
  579. // "CANCEL_STARTED"
  580. // "CANCELLED"
  581. // "DONE"
  582. // "ERROR"
  583. State string `json:"state,omitempty"`
  584. // StateStartTime: [Output-only] The time when this state was entered.
  585. StateStartTime string `json:"stateStartTime,omitempty"`
  586. // ForceSendFields is a list of field names (e.g. "Details") to
  587. // unconditionally include in API requests. By default, fields with
  588. // empty values are omitted from API requests. However, any non-pointer,
  589. // non-interface field appearing in ForceSendFields will be sent to the
  590. // server regardless of whether the field is empty or not. This may be
  591. // used to include empty fields in Patch requests.
  592. ForceSendFields []string `json:"-"`
  593. }
  594. func (s *JobStatus) MarshalJSON() ([]byte, error) {
  595. type noMethod JobStatus
  596. raw := noMethod(*s)
  597. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  598. }
  599. // ListClustersResponse: The list of all clusters in a project.
  600. type ListClustersResponse struct {
  601. // Clusters: [Output-only] The clusters in the project.
  602. Clusters []*Cluster `json:"clusters,omitempty"`
  603. // NextPageToken: The standard List next-page token.
  604. NextPageToken string `json:"nextPageToken,omitempty"`
  605. // ServerResponse contains the HTTP response code and headers from the
  606. // server.
  607. googleapi.ServerResponse `json:"-"`
  608. // ForceSendFields is a list of field names (e.g. "Clusters") to
  609. // unconditionally include in API requests. By default, fields with
  610. // empty values are omitted from API requests. However, any non-pointer,
  611. // non-interface field appearing in ForceSendFields will be sent to the
  612. // server regardless of whether the field is empty or not. This may be
  613. // used to include empty fields in Patch requests.
  614. ForceSendFields []string `json:"-"`
  615. }
  616. func (s *ListClustersResponse) MarshalJSON() ([]byte, error) {
  617. type noMethod ListClustersResponse
  618. raw := noMethod(*s)
  619. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  620. }
  621. // ListJobsResponse: A list of jobs in a project.
  622. type ListJobsResponse struct {
  623. // Jobs: [Output-only] Jobs list.
  624. Jobs []*Job `json:"jobs,omitempty"`
  625. // NextPageToken: [Optional] This token is included in the response if
  626. // there are more results to fetch. To fetch additional results, provide
  627. // this value as the `page_token` in a subsequent ListJobsRequest.
  628. NextPageToken string `json:"nextPageToken,omitempty"`
  629. // ServerResponse contains the HTTP response code and headers from the
  630. // server.
  631. googleapi.ServerResponse `json:"-"`
  632. // ForceSendFields is a list of field names (e.g. "Jobs") to
  633. // unconditionally include in API requests. By default, fields with
  634. // empty values are omitted from API requests. However, any non-pointer,
  635. // non-interface field appearing in ForceSendFields will be sent to the
  636. // server regardless of whether the field is empty or not. This may be
  637. // used to include empty fields in Patch requests.
  638. ForceSendFields []string `json:"-"`
  639. }
  640. func (s *ListJobsResponse) MarshalJSON() ([]byte, error) {
  641. type noMethod ListJobsResponse
  642. raw := noMethod(*s)
  643. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  644. }
  645. // ListOperationsResponse: The response message for
  646. // Operations.ListOperations.
  647. type ListOperationsResponse struct {
  648. // NextPageToken: The standard List next-page token.
  649. NextPageToken string `json:"nextPageToken,omitempty"`
  650. // Operations: A list of operations that matches the specified filter in
  651. // the request.
  652. Operations []*Operation `json:"operations,omitempty"`
  653. // ServerResponse contains the HTTP response code and headers from the
  654. // server.
  655. googleapi.ServerResponse `json:"-"`
  656. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  657. // unconditionally include in API requests. By default, fields with
  658. // empty values are omitted from API requests. However, any non-pointer,
  659. // non-interface field appearing in ForceSendFields will be sent to the
  660. // server regardless of whether the field is empty or not. This may be
  661. // used to include empty fields in Patch requests.
  662. ForceSendFields []string `json:"-"`
  663. }
  664. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  665. type noMethod ListOperationsResponse
  666. raw := noMethod(*s)
  667. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  668. }
  669. // LoggingConfiguration: The runtime logging configuration of the job.
  670. type LoggingConfiguration struct {
  671. // DriverLogLevels: The per-package log levels for the driver. This may
  672. // include "root" package name to configure rootLogger. Examples:
  673. // 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'
  674. DriverLogLevels map[string]string `json:"driverLogLevels,omitempty"`
  675. // ForceSendFields is a list of field names (e.g. "DriverLogLevels") to
  676. // unconditionally include in API requests. By default, fields with
  677. // empty values are omitted from API requests. However, any non-pointer,
  678. // non-interface field appearing in ForceSendFields will be sent to the
  679. // server regardless of whether the field is empty or not. This may be
  680. // used to include empty fields in Patch requests.
  681. ForceSendFields []string `json:"-"`
  682. }
  683. func (s *LoggingConfiguration) MarshalJSON() ([]byte, error) {
  684. type noMethod LoggingConfiguration
  685. raw := noMethod(*s)
  686. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  687. }
  688. // ManagedGroupConfiguration: Specifies the resources used to actively
  689. // manage an instance group.
  690. type ManagedGroupConfiguration struct {
  691. // InstanceGroupManagerName: [Output-only] The name of the Instance
  692. // Group Manager for this group.
  693. InstanceGroupManagerName string `json:"instanceGroupManagerName,omitempty"`
  694. // InstanceTemplateName: [Output-only] The name of the Instance Template
  695. // used for the Managed Instance Group.
  696. InstanceTemplateName string `json:"instanceTemplateName,omitempty"`
  697. // ForceSendFields is a list of field names (e.g.
  698. // "InstanceGroupManagerName") to unconditionally include in API
  699. // requests. By default, fields with empty values are omitted from API
  700. // requests. However, any non-pointer, non-interface field appearing in
  701. // ForceSendFields will be sent to the server regardless of whether the
  702. // field is empty or not. This may be used to include empty fields in
  703. // Patch requests.
  704. ForceSendFields []string `json:"-"`
  705. }
  706. func (s *ManagedGroupConfiguration) MarshalJSON() ([]byte, error) {
  707. type noMethod ManagedGroupConfiguration
  708. raw := noMethod(*s)
  709. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  710. }
  711. // NodeInitializationAction: Specifies an executable to run on a fully
  712. // configured node and a timeout period for executable completion.
  713. type NodeInitializationAction struct {
  714. // ExecutableFile: [Required] Google Cloud Storage URI of executable
  715. // file.
  716. ExecutableFile string `json:"executableFile,omitempty"`
  717. // ExecutionTimeout: [Optional] Amount of time executable has to
  718. // complete. Default is 10 minutes. Cluster creation fails with an
  719. // explanatory error message (the name of the executable that caused the
  720. // error and the exceeded timeout period) if the executable is not
  721. // completed at end of the timeout period.
  722. ExecutionTimeout string `json:"executionTimeout,omitempty"`
  723. // ForceSendFields is a list of field names (e.g. "ExecutableFile") to
  724. // unconditionally include in API requests. By default, fields with
  725. // empty values are omitted from API requests. However, any non-pointer,
  726. // non-interface field appearing in ForceSendFields will be sent to the
  727. // server regardless of whether the field is empty or not. This may be
  728. // used to include empty fields in Patch requests.
  729. ForceSendFields []string `json:"-"`
  730. }
  731. func (s *NodeInitializationAction) MarshalJSON() ([]byte, error) {
  732. type noMethod NodeInitializationAction
  733. raw := noMethod(*s)
  734. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  735. }
  736. // Operation: This resource represents a long-running operation that is
  737. // the result of a network API call.
  738. type Operation struct {
  739. // Done: If the value is `false`, it means the operation is still in
  740. // progress. If true, the operation is completed, and either `error` or
  741. // `response` is available.
  742. Done bool `json:"done,omitempty"`
  743. // Error: The error result of the operation in case of failure.
  744. Error *Status `json:"error,omitempty"`
  745. // Metadata: Service-specific metadata associated with the operation. It
  746. // typically contains progress information and common metadata such as
  747. // create time. Some services might not provide such metadata. Any
  748. // method that returns a long-running operation should document the
  749. // metadata type, if any.
  750. Metadata OperationMetadata `json:"metadata,omitempty"`
  751. // Name: The server-assigned name, which is only unique within the same
  752. // service that originally returns it. If you use the default HTTP
  753. // mapping above, the `name` should have the format of
  754. // `operations/some/unique/name`.
  755. Name string `json:"name,omitempty"`
  756. // Response: The normal response of the operation in case of success. If
  757. // the original method returns no data on success, such as `Delete`, the
  758. // response is `google.protobuf.Empty`. If the original method is
  759. // standard `Get`/`Create`/`Update`, the response should be the
  760. // resource. For other methods, the response should have the type
  761. // `XxxResponse`, where `Xxx` is the original method name. For example,
  762. // if the original method name is `TakeSnapshot()`, the inferred
  763. // response type is `TakeSnapshotResponse`.
  764. Response OperationResponse `json:"response,omitempty"`
  765. // ServerResponse contains the HTTP response code and headers from the
  766. // server.
  767. googleapi.ServerResponse `json:"-"`
  768. // ForceSendFields is a list of field names (e.g. "Done") to
  769. // unconditionally include in API requests. By default, fields with
  770. // empty values are omitted from API requests. However, any non-pointer,
  771. // non-interface field appearing in ForceSendFields will be sent to the
  772. // server regardless of whether the field is empty or not. This may be
  773. // used to include empty fields in Patch requests.
  774. ForceSendFields []string `json:"-"`
  775. }
  776. func (s *Operation) MarshalJSON() ([]byte, error) {
  777. type noMethod Operation
  778. raw := noMethod(*s)
  779. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  780. }
  781. type OperationMetadata interface{}
  782. type OperationResponse interface{}
  783. // OperationMetadata1: Metadata describing the operation.
  784. type OperationMetadata1 struct {
  785. // ClusterName: Name of the cluster for the operation.
  786. ClusterName string `json:"clusterName,omitempty"`
  787. // ClusterUuid: Cluster UUId for the operation.
  788. ClusterUuid string `json:"clusterUuid,omitempty"`
  789. // Details: A message containing any operation metadata details.
  790. Details string `json:"details,omitempty"`
  791. // EndTime: The time that the operation completed.
  792. EndTime string `json:"endTime,omitempty"`
  793. // InnerState: A message containing the detailed operation state.
  794. InnerState string `json:"innerState,omitempty"`
  795. // InsertTime: The time that the operation was requested.
  796. InsertTime string `json:"insertTime,omitempty"`
  797. // StartTime: The time that the operation was started by the server.
  798. StartTime string `json:"startTime,omitempty"`
  799. // State: A message containing the operation state.
  800. //
  801. // Possible values:
  802. // "UNKNOWN"
  803. // "PENDING"
  804. // "RUNNING"
  805. // "DONE"
  806. State string `json:"state,omitempty"`
  807. // Status: [Output-only] Current operation status.
  808. Status *OperationStatus `json:"status,omitempty"`
  809. // StatusHistory: [Output-only] Previous operation status.
  810. StatusHistory []*OperationStatus `json:"statusHistory,omitempty"`
  811. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  812. // unconditionally include in API requests. By default, fields with
  813. // empty values are omitted from API requests. However, any non-pointer,
  814. // non-interface field appearing in ForceSendFields will be sent to the
  815. // server regardless of whether the field is empty or not. This may be
  816. // used to include empty fields in Patch requests.
  817. ForceSendFields []string `json:"-"`
  818. }
  819. func (s *OperationMetadata1) MarshalJSON() ([]byte, error) {
  820. type noMethod OperationMetadata1
  821. raw := noMethod(*s)
  822. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  823. }
  824. // OperationStatus: The status of the operation.
  825. type OperationStatus struct {
  826. // Details: A message containing any operation metadata details.
  827. Details string `json:"details,omitempty"`
  828. // InnerState: A message containing the detailed operation state.
  829. InnerState string `json:"innerState,omitempty"`
  830. // State: A message containing the operation state.
  831. //
  832. // Possible values:
  833. // "UNKNOWN"
  834. // "PENDING"
  835. // "RUNNING"
  836. // "DONE"
  837. State string `json:"state,omitempty"`
  838. // StateStartTime: The time this state was entered.
  839. StateStartTime string `json:"stateStartTime,omitempty"`
  840. // ForceSendFields is a list of field names (e.g. "Details") to
  841. // unconditionally include in API requests. By default, fields with
  842. // empty values are omitted from API requests. However, any non-pointer,
  843. // non-interface field appearing in ForceSendFields will be sent to the
  844. // server regardless of whether the field is empty or not. This may be
  845. // used to include empty fields in Patch requests.
  846. ForceSendFields []string `json:"-"`
  847. }
  848. func (s *OperationStatus) MarshalJSON() ([]byte, error) {
  849. type noMethod OperationStatus
  850. raw := noMethod(*s)
  851. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  852. }
  853. // PigJob: A Cloud Dataproc job for running Pig queries on YARN.
  854. type PigJob struct {
  855. // ContinueOnFailure: [Optional] Whether to continue executing queries
  856. // if a query fails. The default value is `false`. Setting to `true` can
  857. // be useful when executing independent parallel queries.
  858. ContinueOnFailure bool `json:"continueOnFailure,omitempty"`
  859. // JarFileUris: [Optional] HCFS URIs of jar files to add to the
  860. // CLASSPATH of the Pig Client and Hadoop MapReduce (MR) tasks. Can
  861. // contain Pig UDFs.
  862. JarFileUris []string `json:"jarFileUris,omitempty"`
  863. // LoggingConfiguration: [Optional] The runtime log configuration for
  864. // job execution.
  865. LoggingConfiguration *LoggingConfiguration `json:"loggingConfiguration,omitempty"`
  866. // Properties: [Optional] A mapping of property names to values, used to
  867. // configure Pig. Properties that conflict with values set by the Cloud
  868. // Dataproc API may be overwritten. Can include properties set in
  869. // /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and
  870. // classes in user code.
  871. Properties map[string]string `json:"properties,omitempty"`
  872. // QueryFileUri: The HCFS URI of the script that contains the Pig
  873. // queries.
  874. QueryFileUri string `json:"queryFileUri,omitempty"`
  875. // QueryList: A list of queries.
  876. QueryList *QueryList `json:"queryList,omitempty"`
  877. // ScriptVariables: [Optional] Mapping of query variable names to values
  878. // (equivalent to the Pig command: `name=[value]`).
  879. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  880. // ForceSendFields is a list of field names (e.g. "ContinueOnFailure")
  881. // to unconditionally include in API requests. By default, fields with
  882. // empty values are omitted from API requests. However, any non-pointer,
  883. // non-interface field appearing in ForceSendFields will be sent to the
  884. // server regardless of whether the field is empty or not. This may be
  885. // used to include empty fields in Patch requests.
  886. ForceSendFields []string `json:"-"`
  887. }
  888. func (s *PigJob) MarshalJSON() ([]byte, error) {
  889. type noMethod PigJob
  890. raw := noMethod(*s)
  891. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  892. }
  893. // PySparkJob: A Cloud Dataproc job for running PySpark applications on
  894. // YARN.
  895. type PySparkJob struct {
  896. // ArchiveUris: [Optional] HCFS URIs of archives to be extracted in the
  897. // working directory of .jar, .tar, .tar.gz, .tgz, and .zip.
  898. ArchiveUris []string `json:"archiveUris,omitempty"`
  899. // Args: [Optional] The arguments to pass to the driver. Do not include
  900. // arguments, such as `--conf`, that can be set as job properties, since
  901. // a collision may occur that causes an incorrect job submission.
  902. Args []string `json:"args,omitempty"`
  903. // FileUris: [Optional] HCFS URIs of files to be copied to the working
  904. // directory of Python drivers and distributed tasks. Useful for naively
  905. // parallel tasks.
  906. FileUris []string `json:"fileUris,omitempty"`
  907. // JarFileUris: [Optional] HCFS URIs of jar files to add to the
  908. // CLASSPATHs of the Python driver and tasks.
  909. JarFileUris []string `json:"jarFileUris,omitempty"`
  910. // LoggingConfiguration: [Optional] The runtime log configuration for
  911. // job execution.
  912. LoggingConfiguration *LoggingConfiguration `json:"loggingConfiguration,omitempty"`
  913. // MainPythonFileUri: [Required] The Hadoop Compatible Filesystem (HCFS)
  914. // URI of the main Python file to use as the driver. Must be a .py file.
  915. MainPythonFileUri string `json:"mainPythonFileUri,omitempty"`
  916. // Properties: [Optional] A mapping of property names to values, used to
  917. // configure PySpark. Properties that conflict with values set by the
  918. // Cloud Dataproc API may be overwritten. Can include properties set in
  919. // /etc/spark/conf/spark-defaults.conf and classes in user code.
  920. Properties map[string]string `json:"properties,omitempty"`
  921. // PythonFileUris: [Optional] HCFS file URIs of Python files to pass to
  922. // the PySpark framework. Supported file types: .py, .egg, and .zip.
  923. PythonFileUris []string `json:"pythonFileUris,omitempty"`
  924. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  925. // unconditionally include in API requests. By default, fields with
  926. // empty values are omitted from API requests. However, any non-pointer,
  927. // non-interface field appearing in ForceSendFields will be sent to the
  928. // server regardless of whether the field is empty or not. This may be
  929. // used to include empty fields in Patch requests.
  930. ForceSendFields []string `json:"-"`
  931. }
  932. func (s *PySparkJob) MarshalJSON() ([]byte, error) {
  933. type noMethod PySparkJob
  934. raw := noMethod(*s)
  935. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  936. }
  937. // QueryList: A list of queries to run on a cluster.
  938. type QueryList struct {
  939. // Queries: [Required] The queries to execute. You do not need to
  940. // terminate a query with a semicolon. Multiple queries can be specified
  941. // in one string by separating each with a semicolon. Here is an example
  942. // of an Cloud Dataproc API snippet that uses a QueryList to specify a
  943. // HiveJob: "hiveJob": { "queryList": { "queries": [ "query1", "query2",
  944. // "query3;query4", ] } }
  945. Queries []string `json:"queries,omitempty"`
  946. // ForceSendFields is a list of field names (e.g. "Queries") to
  947. // unconditionally include in API requests. By default, fields with
  948. // empty values are omitted from API requests. However, any non-pointer,
  949. // non-interface field appearing in ForceSendFields will be sent to the
  950. // server regardless of whether the field is empty or not. This may be
  951. // used to include empty fields in Patch requests.
  952. ForceSendFields []string `json:"-"`
  953. }
  954. func (s *QueryList) MarshalJSON() ([]byte, error) {
  955. type noMethod QueryList
  956. raw := noMethod(*s)
  957. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  958. }
  959. // SoftwareConfiguration: Specifies the selection and configuration of
  960. // software inside the cluster.
  961. type SoftwareConfiguration struct {
  962. // ImageVersion: [Optional] The version of software inside the cluster.
  963. // It must match the regular expression `[0-9]+\.[0-9]+`. If
  964. // unspecified, it defaults to the latest version (see [Cloud Dataproc
  965. // Versioning](/dataproc/versioning)).
  966. ImageVersion string `json:"imageVersion,omitempty"`
  967. // ForceSendFields is a list of field names (e.g. "ImageVersion") to
  968. // unconditionally include in API requests. By default, fields with
  969. // empty values are omitted from API requests. However, any non-pointer,
  970. // non-interface field appearing in ForceSendFields will be sent to the
  971. // server regardless of whether the field is empty or not. This may be
  972. // used to include empty fields in Patch requests.
  973. ForceSendFields []string `json:"-"`
  974. }
  975. func (s *SoftwareConfiguration) MarshalJSON() ([]byte, error) {
  976. type noMethod SoftwareConfiguration
  977. raw := noMethod(*s)
  978. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  979. }
  980. // SparkJob: A Cloud Dataproc job for running Spark applications on
  981. // YARN.
  982. type SparkJob struct {
  983. // ArchiveUris: [Optional] HCFS URIs of archives to be extracted in the
  984. // working directory of Spark drivers and tasks. Supported file types:
  985. // .jar, .tar, .tar.gz, .tgz, and .zip.
  986. ArchiveUris []string `json:"archiveUris,omitempty"`
  987. // Args: [Optional] The arguments to pass to the driver. Do not include
  988. // arguments, such as `--conf`, that can be set as job properties, since
  989. // a collision may occur that causes an incorrect job submission.
  990. Args []string `json:"args,omitempty"`
  991. // FileUris: [Optional] HCFS URIs of files to be copied to the working
  992. // directory of Spark drivers and distributed tasks. Useful for naively
  993. // parallel tasks.
  994. FileUris []string `json:"fileUris,omitempty"`
  995. // JarFileUris: [Optional] HCFS URIs of jar files to add to the
  996. // CLASSPATHs of the Spark driver and tasks.
  997. JarFileUris []string `json:"jarFileUris,omitempty"`
  998. // LoggingConfiguration: [Optional] The runtime log configuration for
  999. // job execution.
  1000. LoggingConfiguration *LoggingConfiguration `json:"loggingConfiguration,omitempty"`
  1001. // MainClass: The name of the driver's main class. The jar file that
  1002. // contains the class must be in the default CLASSPATH or specified in
  1003. // `jar_file_uris`.
  1004. MainClass string `json:"mainClass,omitempty"`
  1005. // MainJarFileUri: The Hadoop Compatible Filesystem (HCFS) URI of the
  1006. // jar file that contains the main class.
  1007. MainJarFileUri string `json:"mainJarFileUri,omitempty"`
  1008. // Properties: [Optional] A mapping of property names to values, used to
  1009. // configure Spark. Properties that conflict with values set by the
  1010. // Cloud Dataproc API may be overwritten. Can include properties set in
  1011. // /etc/spark/conf/spark-defaults.conf and classes in user code.
  1012. Properties map[string]string `json:"properties,omitempty"`
  1013. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  1014. // unconditionally include in API requests. By default, fields with
  1015. // empty values are omitted from API requests. However, any non-pointer,
  1016. // non-interface field appearing in ForceSendFields will be sent to the
  1017. // server regardless of whether the field is empty or not. This may be
  1018. // used to include empty fields in Patch requests.
  1019. ForceSendFields []string `json:"-"`
  1020. }
  1021. func (s *SparkJob) MarshalJSON() ([]byte, error) {
  1022. type noMethod SparkJob
  1023. raw := noMethod(*s)
  1024. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1025. }
  1026. // SparkSqlJob: A Cloud Dataproc job for running Spark SQL queries.
  1027. type SparkSqlJob struct {
  1028. // JarFileUris: [Optional] HCFS URIs of jar files to be added to the
  1029. // Spark CLASSPATH.
  1030. JarFileUris []string `json:"jarFileUris,omitempty"`
  1031. // LoggingConfiguration: [Optional] The runtime log configuration for
  1032. // job execution.
  1033. LoggingConfiguration *LoggingConfiguration `json:"loggingConfiguration,omitempty"`
  1034. // Properties: [Optional] A mapping of property names to values, used to
  1035. // configure Spark SQL's SparkConf. Properties that conflict with values
  1036. // set by the Cloud Dataproc API may be overwritten.
  1037. Properties map[string]string `json:"properties,omitempty"`
  1038. // QueryFileUri: The HCFS URI of the script that contains SQL queries.
  1039. QueryFileUri string `json:"queryFileUri,omitempty"`
  1040. // QueryList: A list of queries.
  1041. QueryList *QueryList `json:"queryList,omitempty"`
  1042. // ScriptVariables: [Optional] Mapping of query variable names to values
  1043. // (equivalent to the Spark SQL command: SET `name="value";`).
  1044. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  1045. // ForceSendFields is a list of field names (e.g. "JarFileUris") to
  1046. // unconditionally include in API requests. By default, fields with
  1047. // empty values are omitted from API requests. However, any non-pointer,
  1048. // non-interface field appearing in ForceSendFields will be sent to the
  1049. // server regardless of whether the field is empty or not. This may be
  1050. // used to include empty fields in Patch requests.
  1051. ForceSendFields []string `json:"-"`
  1052. }
  1053. func (s *SparkSqlJob) MarshalJSON() ([]byte, error) {
  1054. type noMethod SparkSqlJob
  1055. raw := noMethod(*s)
  1056. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1057. }
  1058. // Status: The `Status` type defines a logical error model that is
  1059. // suitable for different programming environments, including REST APIs
  1060. // and RPC APIs. It is used by [gRPC](https://github.com/grpc). The
  1061. // error model is designed to be: - Simple to use and understand for
  1062. // most users - Flexible enough to meet unexpected needs # Overview The
  1063. // `Status` message contains three pieces of data: error code, error
  1064. // message, and error details. The error code should be an enum value of
  1065. // google.rpc.Code, but it may accept additional error codes if needed.
  1066. // The error message should be a developer-facing English message that
  1067. // helps developers *understand* and *resolve* the error. If a localized
  1068. // user-facing error message is needed, put the localized message in the
  1069. // error details or localize it in the client. The optional error
  1070. // details may contain arbitrary information about the error. There is a
  1071. // predefined set of error detail types in the package `google.rpc`
  1072. // which can be used for common error conditions. # Language mapping The
  1073. // `Status` message is the logical representation of the error model,
  1074. // but it is not necessarily the actual wire format. When the `Status`
  1075. // message is exposed in different client libraries and different wire
  1076. // protocols, it can be mapped differently. For example, it will likely
  1077. // be mapped to some exceptions in Java, but more likely mapped to some
  1078. // error codes in C. # Other uses The error model and the `Status`
  1079. // message can be used in a variety of environments, either with or
  1080. // without APIs, to provide a consistent developer experience across
  1081. // different environments. Example uses of this error model include: -
  1082. // Partial errors. If a service needs to return partial errors to the
  1083. // client, it may embed the `Status` in the normal response to indicate
  1084. // the partial errors. - Workflow errors. A typical workflow has
  1085. // multiple steps. Each step may have a `Status` message for error
  1086. // reporting purpose. - Batch operations. If a client uses batch request
  1087. // and batch response, the `Status` message should be used directly
  1088. // inside batch response, one for each error sub-response. -
  1089. // Asynchronous operations. If an API call embeds asynchronous operation
  1090. // results in its response, the status of those operations should be
  1091. // represented directly using the `Status` message. - Logging. If some
  1092. // API errors are stored in logs, the message `Status` could be used
  1093. // directly after any stripping needed for security/privacy reasons.
  1094. type Status struct {
  1095. // Code: The status code, which should be an enum value of
  1096. // google.rpc.Code.
  1097. Code int64 `json:"code,omitempty"`
  1098. // Details: A list of messages that carry the error details. There will
  1099. // be a common set of message types for APIs to use.
  1100. Details []StatusDetails `json:"details,omitempty"`
  1101. // Message: A developer-facing error message, which should be in
  1102. // English. Any user-facing error message should be localized and sent
  1103. // in the google.rpc.Status.details field, or localized by the client.
  1104. Message string `json:"message,omitempty"`
  1105. // ForceSendFields is a list of field names (e.g. "Code") to
  1106. // unconditionally include in API requests. By default, fields with
  1107. // empty values are omitted from API requests. However, any non-pointer,
  1108. // non-interface field appearing in ForceSendFields will be sent to the
  1109. // server regardless of whether the field is empty or not. This may be
  1110. // used to include empty fields in Patch requests.
  1111. ForceSendFields []string `json:"-"`
  1112. }
  1113. func (s *Status) MarshalJSON() ([]byte, error) {
  1114. type noMethod Status
  1115. raw := noMethod(*s)
  1116. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1117. }
  1118. type StatusDetails interface{}
  1119. // SubmitJobRequest: A request to submit a job.
  1120. type SubmitJobRequest struct {
  1121. // Job: [Required] The job resource.
  1122. Job *Job `json:"job,omitempty"`
  1123. // ForceSendFields is a list of field names (e.g. "Job") to
  1124. // unconditionally include in API requests. By default, fields with
  1125. // empty values are omitted from API requests. However, any non-pointer,
  1126. // non-interface field appearing in ForceSendFields will be sent to the
  1127. // server regardless of whether the field is empty or not. This may be
  1128. // used to include empty fields in Patch requests.
  1129. ForceSendFields []string `json:"-"`
  1130. }
  1131. func (s *SubmitJobRequest) MarshalJSON() ([]byte, error) {
  1132. type noMethod SubmitJobRequest
  1133. raw := noMethod(*s)
  1134. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1135. }
  1136. // YarnApplication: A YARN application created by a job. Application
  1137. // information is a subset of
  1138. // org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto.
  1139. type YarnApplication struct {
  1140. // Name: [Required] The application name.
  1141. Name string `json:"name,omitempty"`
  1142. // Progress: [Required] The numerical progress of the application, from
  1143. // 1 to 100.
  1144. Progress float64 `json:"progress,omitempty"`
  1145. // State: [Required] The application state.
  1146. //
  1147. // Possible values:
  1148. // "STATE_UNSPECIFIED"
  1149. // "NEW"
  1150. // "NEW_SAVING"
  1151. // "SUBMITTED"
  1152. // "ACCEPTED"
  1153. // "RUNNING"
  1154. // "FINISHED"
  1155. // "FAILED"
  1156. // "KILLED"
  1157. State string `json:"state,omitempty"`
  1158. // TrackingUrl: [Optional] The HTTP URL of the ApplicationMaster,
  1159. // HistoryServer, or TimelineServer that provides application-specific
  1160. // information. The URL uses the internal hostname, and requires a proxy
  1161. // server for resolution and, possibly, access.
  1162. TrackingUrl string `json:"trackingUrl,omitempty"`
  1163. // ForceSendFields is a list of field names (e.g. "Name") to
  1164. // unconditionally include in API requests. By default, fields with
  1165. // empty values are omitted from API requests. However, any non-pointer,
  1166. // non-interface field appearing in ForceSendFields will be sent to the
  1167. // server regardless of whether the field is empty or not. This may be
  1168. // used to include empty fields in Patch requests.
  1169. ForceSendFields []string `json:"-"`
  1170. }
  1171. func (s *YarnApplication) MarshalJSON() ([]byte, error) {
  1172. type noMethod YarnApplication
  1173. raw := noMethod(*s)
  1174. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1175. }
  1176. // method id "dataproc.operations.cancel":
  1177. type OperationsCancelCall struct {
  1178. s *Service
  1179. name string
  1180. canceloperationrequest *CancelOperationRequest
  1181. urlParams_ gensupport.URLParams
  1182. ctx_ context.Context
  1183. }
  1184. // Cancel: Starts asynchronous cancellation on a long-running operation.
  1185. // The server makes a best effort to cancel the operation, but success
  1186. // is not guaranteed. If the server doesn't support this method, it
  1187. // returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use
  1188. // [operations.get](/dataproc/reference/rest/v1beta1/operations/get) or
  1189. // other methods to check whether the cancellation succeeded or whether
  1190. // the operation completed despite cancellation.
  1191. func (r *OperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OperationsCancelCall {
  1192. c := &OperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1193. c.name = name
  1194. c.canceloperationrequest = canceloperationrequest
  1195. return c
  1196. }
  1197. // Fields allows partial responses to be retrieved. See
  1198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1199. // for more information.
  1200. func (c *OperationsCancelCall) Fields(s ...googleapi.Field) *OperationsCancelCall {
  1201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1202. return c
  1203. }
  1204. // Context sets the context to be used in this call's Do method. Any
  1205. // pending HTTP request will be aborted if the provided context is
  1206. // canceled.
  1207. func (c *OperationsCancelCall) Context(ctx context.Context) *OperationsCancelCall {
  1208. c.ctx_ = ctx
  1209. return c
  1210. }
  1211. func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  1212. var body io.Reader = nil
  1213. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  1214. if err != nil {
  1215. return nil, err
  1216. }
  1217. ctype := "application/json"
  1218. c.urlParams_.Set("alt", alt)
  1219. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel")
  1220. urls += "?" + c.urlParams_.Encode()
  1221. req, _ := http.NewRequest("POST", urls, body)
  1222. googleapi.Expand(req.URL, map[string]string{
  1223. "name": c.name,
  1224. })
  1225. req.Header.Set("Content-Type", ctype)
  1226. req.Header.Set("User-Agent", c.s.userAgent())
  1227. if c.ctx_ != nil {
  1228. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1229. }
  1230. return c.s.client.Do(req)
  1231. }
  1232. // Do executes the "dataproc.operations.cancel" call.
  1233. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  1234. // code is an error. Response headers are in either
  1235. // *Empty.ServerResponse.Header or (if a response was returned at all)
  1236. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1237. // check whether the returned error was because http.StatusNotModified
  1238. // was returned.
  1239. func (c *OperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1240. gensupport.SetOptions(c.urlParams_, opts...)
  1241. res, err := c.doRequest("json")
  1242. if res != nil && res.StatusCode == http.StatusNotModified {
  1243. if res.Body != nil {
  1244. res.Body.Close()
  1245. }
  1246. return nil, &googleapi.Error{
  1247. Code: res.StatusCode,
  1248. Header: res.Header,
  1249. }
  1250. }
  1251. if err != nil {
  1252. return nil, err
  1253. }
  1254. defer googleapi.CloseBody(res)
  1255. if err := googleapi.CheckResponse(res); err != nil {
  1256. return nil, err
  1257. }
  1258. ret := &Empty{
  1259. ServerResponse: googleapi.ServerResponse{
  1260. Header: res.Header,
  1261. HTTPStatusCode: res.StatusCode,
  1262. },
  1263. }
  1264. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1265. return nil, err
  1266. }
  1267. return ret, nil
  1268. // {
  1269. // "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 can use [operations.get](/dataproc/reference/rest/v1beta1/operations/get) or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation.",
  1270. // "httpMethod": "POST",
  1271. // "id": "dataproc.operations.cancel",
  1272. // "parameterOrder": [
  1273. // "name"
  1274. // ],
  1275. // "parameters": {
  1276. // "name": {
  1277. // "description": "The name of the operation resource to be cancelled.",
  1278. // "location": "path",
  1279. // "pattern": "^operations/.*$",
  1280. // "required": true,
  1281. // "type": "string"
  1282. // }
  1283. // },
  1284. // "path": "v1beta1/{+name}:cancel",
  1285. // "request": {
  1286. // "$ref": "CancelOperationRequest"
  1287. // },
  1288. // "response": {
  1289. // "$ref": "Empty"
  1290. // },
  1291. // "scopes": [
  1292. // "https://www.googleapis.com/auth/cloud-platform"
  1293. // ]
  1294. // }
  1295. }
  1296. // method id "dataproc.operations.delete":
  1297. type OperationsDeleteCall struct {
  1298. s *Service
  1299. name string
  1300. urlParams_ gensupport.URLParams
  1301. ctx_ context.Context
  1302. }
  1303. // Delete: Deletes a long-running operation. This method indicates that
  1304. // the client is no longer interested in the operation result. It does
  1305. // not cancel the operation. If the server doesn't support this method,
  1306. // it returns `google.rpc.Code.UNIMPLEMENTED`.
  1307. func (r *OperationsService) Delete(name string) *OperationsDeleteCall {
  1308. c := &OperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1309. c.name = name
  1310. return c
  1311. }
  1312. // Fields allows partial responses to be retrieved. See
  1313. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1314. // for more information.
  1315. func (c *OperationsDeleteCall) Fields(s ...googleapi.Field) *OperationsDeleteCall {
  1316. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1317. return c
  1318. }
  1319. // Context sets the context to be used in this call's Do method. Any
  1320. // pending HTTP request will be aborted if the provided context is
  1321. // canceled.
  1322. func (c *OperationsDeleteCall) Context(ctx context.Context) *OperationsDeleteCall {
  1323. c.ctx_ = ctx
  1324. return c
  1325. }
  1326. func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1327. var body io.Reader = nil
  1328. c.urlParams_.Set("alt", alt)
  1329. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1330. urls += "?" + c.urlParams_.Encode()
  1331. req, _ := http.NewRequest("DELETE", urls, body)
  1332. googleapi.Expand(req.URL, map[string]string{
  1333. "name": c.name,
  1334. })
  1335. req.Header.Set("User-Agent", c.s.userAgent())
  1336. if c.ctx_ != nil {
  1337. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1338. }
  1339. return c.s.client.Do(req)
  1340. }
  1341. // Do executes the "dataproc.operations.delete" call.
  1342. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  1343. // code is an error. Response headers are in either
  1344. // *Empty.ServerResponse.Header or (if a response was returned at all)
  1345. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1346. // check whether the returned error was because http.StatusNotModified
  1347. // was returned.
  1348. func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1349. gensupport.SetOptions(c.urlParams_, opts...)
  1350. res, err := c.doRequest("json")
  1351. if res != nil && res.StatusCode == http.StatusNotModified {
  1352. if res.Body != nil {
  1353. res.Body.Close()
  1354. }
  1355. return nil, &googleapi.Error{
  1356. Code: res.StatusCode,
  1357. Header: res.Header,
  1358. }
  1359. }
  1360. if err != nil {
  1361. return nil, err
  1362. }
  1363. defer googleapi.CloseBody(res)
  1364. if err := googleapi.CheckResponse(res); err != nil {
  1365. return nil, err
  1366. }
  1367. ret := &Empty{
  1368. ServerResponse: googleapi.ServerResponse{
  1369. Header: res.Header,
  1370. HTTPStatusCode: res.StatusCode,
  1371. },
  1372. }
  1373. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1374. return nil, err
  1375. }
  1376. return ret, nil
  1377. // {
  1378. // "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.",
  1379. // "httpMethod": "DELETE",
  1380. // "id": "dataproc.operations.delete",
  1381. // "parameterOrder": [
  1382. // "name"
  1383. // ],
  1384. // "parameters": {
  1385. // "name": {
  1386. // "description": "The name of the operation resource to be deleted.",
  1387. // "location": "path",
  1388. // "pattern": "^operations/.*$",
  1389. // "required": true,
  1390. // "type": "string"
  1391. // }
  1392. // },
  1393. // "path": "v1beta1/{+name}",
  1394. // "response": {
  1395. // "$ref": "Empty"
  1396. // },
  1397. // "scopes": [
  1398. // "https://www.googleapis.com/auth/cloud-platform"
  1399. // ]
  1400. // }
  1401. }
  1402. // method id "dataproc.operations.get":
  1403. type OperationsGetCall struct {
  1404. s *Service
  1405. name string
  1406. urlParams_ gensupport.URLParams
  1407. ifNoneMatch_ string
  1408. ctx_ context.Context
  1409. }
  1410. // Get: Gets the latest state of a long-running operation. Clients can
  1411. // use this method to poll the operation result at intervals as
  1412. // recommended by the API service.
  1413. func (r *OperationsService) Get(name string) *OperationsGetCall {
  1414. c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1415. c.name = name
  1416. return c
  1417. }
  1418. // Fields allows partial responses to be retrieved. See
  1419. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1420. // for more information.
  1421. func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
  1422. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1423. return c
  1424. }
  1425. // IfNoneMatch sets the optional parameter which makes the operation
  1426. // fail if the object's ETag matches the given value. This is useful for
  1427. // getting updates only after the object has changed since the last
  1428. // request. Use googleapi.IsNotModified to check whether the response
  1429. // error from Do is the result of In-None-Match.
  1430. func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
  1431. c.ifNoneMatch_ = entityTag
  1432. return c
  1433. }
  1434. // Context sets the context to be used in this call's Do method. Any
  1435. // pending HTTP request will be aborted if the provided context is
  1436. // canceled.
  1437. func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
  1438. c.ctx_ = ctx
  1439. return c
  1440. }
  1441. func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
  1442. var body io.Reader = nil
  1443. c.urlParams_.Set("alt", alt)
  1444. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1445. urls += "?" + c.urlParams_.Encode()
  1446. req, _ := http.NewRequest("GET", urls, body)
  1447. googleapi.Expand(req.URL, map[string]string{
  1448. "name": c.name,
  1449. })
  1450. req.Header.Set("User-Agent", c.s.userAgent())
  1451. if c.ifNoneMatch_ != "" {
  1452. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1453. }
  1454. if c.ctx_ != nil {
  1455. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1456. }
  1457. return c.s.client.Do(req)
  1458. }
  1459. // Do executes the "dataproc.operations.get" call.
  1460. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1461. // status code is an error. Response headers are in either
  1462. // *Operation.ServerResponse.Header or (if a response was returned at
  1463. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1464. // to check whether the returned error was because
  1465. // http.StatusNotModified was returned.
  1466. func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1467. gensupport.SetOptions(c.urlParams_, opts...)
  1468. res, err := c.doRequest("json")
  1469. if res != nil && res.StatusCode == http.StatusNotModified {
  1470. if res.Body != nil {
  1471. res.Body.Close()
  1472. }
  1473. return nil, &googleapi.Error{
  1474. Code: res.StatusCode,
  1475. Header: res.Header,
  1476. }
  1477. }
  1478. if err != nil {
  1479. return nil, err
  1480. }
  1481. defer googleapi.CloseBody(res)
  1482. if err := googleapi.CheckResponse(res); err != nil {
  1483. return nil, err
  1484. }
  1485. ret := &Operation{
  1486. ServerResponse: googleapi.ServerResponse{
  1487. Header: res.Header,
  1488. HTTPStatusCode: res.StatusCode,
  1489. },
  1490. }
  1491. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1492. return nil, err
  1493. }
  1494. return ret, nil
  1495. // {
  1496. // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
  1497. // "httpMethod": "GET",
  1498. // "id": "dataproc.operations.get",
  1499. // "parameterOrder": [
  1500. // "name"
  1501. // ],
  1502. // "parameters": {
  1503. // "name": {
  1504. // "description": "The name of the operation resource.",
  1505. // "location": "path",
  1506. // "pattern": "^operations/.*$",
  1507. // "required": true,
  1508. // "type": "string"
  1509. // }
  1510. // },
  1511. // "path": "v1beta1/{+name}",
  1512. // "response": {
  1513. // "$ref": "Operation"
  1514. // },
  1515. // "scopes": [
  1516. // "https://www.googleapis.com/auth/cloud-platform"
  1517. // ]
  1518. // }
  1519. }
  1520. // method id "dataproc.operations.list":
  1521. type OperationsListCall struct {
  1522. s *Service
  1523. name string
  1524. urlParams_ gensupport.URLParams
  1525. ifNoneMatch_ string
  1526. ctx_ context.Context
  1527. }
  1528. // List: Lists operations that match the specified filter in the
  1529. // request. If the server doesn't support this method, it returns
  1530. // `UNIMPLEMENTED`. NOTE: the `name` binding below allows API services
  1531. // to override the binding to use different resource name schemes, such
  1532. // as `users/*/operations`.
  1533. func (r *OperationsService) List(name string) *OperationsListCall {
  1534. c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1535. c.name = name
  1536. return c
  1537. }
  1538. // Filter sets the optional parameter "filter": The standard list
  1539. // filter.
  1540. func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
  1541. c.urlParams_.Set("filter", filter)
  1542. return c
  1543. }
  1544. // PageSize sets the optional parameter "pageSize": The standard list
  1545. // page size.
  1546. func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall {
  1547. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1548. return c
  1549. }
  1550. // PageToken sets the optional parameter "pageToken": The standard list
  1551. // page token.
  1552. func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
  1553. c.urlParams_.Set("pageToken", pageToken)
  1554. return c
  1555. }
  1556. // Fields allows partial responses to be retrieved. See
  1557. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1558. // for more information.
  1559. func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
  1560. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1561. return c
  1562. }
  1563. // IfNoneMatch sets the optional parameter which makes the operation
  1564. // fail if the object's ETag matches the given value. This is useful for
  1565. // getting updates only after the object has changed since the last
  1566. // request. Use googleapi.IsNotModified to check whether the response
  1567. // error from Do is the result of In-None-Match.
  1568. func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
  1569. c.ifNoneMatch_ = entityTag
  1570. return c
  1571. }
  1572. // Context sets the context to be used in this call's Do method. Any
  1573. // pending HTTP request will be aborted if the provided context is
  1574. // canceled.
  1575. func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
  1576. c.ctx_ = ctx
  1577. return c
  1578. }
  1579. func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
  1580. var body io.Reader = nil
  1581. c.urlParams_.Set("alt", alt)
  1582. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1583. urls += "?" + c.urlParams_.Encode()
  1584. req, _ := http.NewRequest("GET", urls, body)
  1585. googleapi.Expand(req.URL, map[string]string{
  1586. "name": c.name,
  1587. })
  1588. req.Header.Set("User-Agent", c.s.userAgent())
  1589. if c.ifNoneMatch_ != "" {
  1590. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1591. }
  1592. if c.ctx_ != nil {
  1593. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1594. }
  1595. return c.s.client.Do(req)
  1596. }
  1597. // Do executes the "dataproc.operations.list" call.
  1598. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  1599. // non-2xx status code is an error. Response headers are in either
  1600. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  1601. // returned at all) in error.(*googleapi.Error).Header. Use
  1602. // googleapi.IsNotModified to check whether the returned error was
  1603. // because http.StatusNotModified was returned.
  1604. func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  1605. gensupport.SetOptions(c.urlParams_, opts...)
  1606. res, err := c.doRequest("json")
  1607. if res != nil && res.StatusCode == http.StatusNotModified {
  1608. if res.Body != nil {
  1609. res.Body.Close()
  1610. }
  1611. return nil, &googleapi.Error{
  1612. Code: res.StatusCode,
  1613. Header: res.Header,
  1614. }
  1615. }
  1616. if err != nil {
  1617. return nil, err
  1618. }
  1619. defer googleapi.CloseBody(res)
  1620. if err := googleapi.CheckResponse(res); err != nil {
  1621. return nil, err
  1622. }
  1623. ret := &ListOperationsResponse{
  1624. ServerResponse: googleapi.ServerResponse{
  1625. Header: res.Header,
  1626. HTTPStatusCode: res.StatusCode,
  1627. },
  1628. }
  1629. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1630. return nil, err
  1631. }
  1632. return ret, nil
  1633. // {
  1634. // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding below allows API services to override the binding to use different resource name schemes, such as `users/*/operations`.",
  1635. // "httpMethod": "GET",
  1636. // "id": "dataproc.operations.list",
  1637. // "parameterOrder": [
  1638. // "name"
  1639. // ],
  1640. // "parameters": {
  1641. // "filter": {
  1642. // "description": "The standard list filter.",
  1643. // "location": "query",
  1644. // "type": "string"
  1645. // },
  1646. // "name": {
  1647. // "description": "The name of the operation collection.",
  1648. // "location": "path",
  1649. // "pattern": "^operations$",
  1650. // "required": true,
  1651. // "type": "string"
  1652. // },
  1653. // "pageSize": {
  1654. // "description": "The standard list page size.",
  1655. // "format": "int32",
  1656. // "location": "query",
  1657. // "type": "integer"
  1658. // },
  1659. // "pageToken": {
  1660. // "description": "The standard list page token.",
  1661. // "location": "query",
  1662. // "type": "string"
  1663. // }
  1664. // },
  1665. // "path": "v1beta1/{+name}",
  1666. // "response": {
  1667. // "$ref": "ListOperationsResponse"
  1668. // },
  1669. // "scopes": [
  1670. // "https://www.googleapis.com/auth/cloud-platform"
  1671. // ]
  1672. // }
  1673. }
  1674. // Pages invokes f for each page of results.
  1675. // A non-nil error returned from f will halt the iteration.
  1676. // The provided context supersedes any context provided to the Context method.
  1677. func (c *OperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  1678. c.ctx_ = ctx
  1679. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1680. for {
  1681. x, err := c.Do()
  1682. if err != nil {
  1683. return err
  1684. }
  1685. if err := f(x); err != nil {
  1686. return err
  1687. }
  1688. if x.NextPageToken == "" {
  1689. return nil
  1690. }
  1691. c.PageToken(x.NextPageToken)
  1692. }
  1693. }
  1694. // method id "dataproc.projects.clusters.create":
  1695. type ProjectsClustersCreateCall struct {
  1696. s *Service
  1697. projectId string
  1698. cluster *Cluster
  1699. urlParams_ gensupport.URLParams
  1700. ctx_ context.Context
  1701. }
  1702. // Create: Creates a cluster in a project.
  1703. func (r *ProjectsClustersService) Create(projectId string, cluster *Cluster) *ProjectsClustersCreateCall {
  1704. c := &ProjectsClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1705. c.projectId = projectId
  1706. c.cluster = cluster
  1707. return c
  1708. }
  1709. // Fields allows partial responses to be retrieved. See
  1710. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1711. // for more information.
  1712. func (c *ProjectsClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsClustersCreateCall {
  1713. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1714. return c
  1715. }
  1716. // Context sets the context to be used in this call's Do method. Any
  1717. // pending HTTP request will be aborted if the provided context is
  1718. // canceled.
  1719. func (c *ProjectsClustersCreateCall) Context(ctx context.Context) *ProjectsClustersCreateCall {
  1720. c.ctx_ = ctx
  1721. return c
  1722. }
  1723. func (c *ProjectsClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  1724. var body io.Reader = nil
  1725. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster)
  1726. if err != nil {
  1727. return nil, err
  1728. }
  1729. ctype := "application/json"
  1730. c.urlParams_.Set("alt", alt)
  1731. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/clusters")
  1732. urls += "?" + c.urlParams_.Encode()
  1733. req, _ := http.NewRequest("POST", urls, body)
  1734. googleapi.Expand(req.URL, map[string]string{
  1735. "projectId": c.projectId,
  1736. })
  1737. req.Header.Set("Content-Type", ctype)
  1738. req.Header.Set("User-Agent", c.s.userAgent())
  1739. if c.ctx_ != nil {
  1740. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1741. }
  1742. return c.s.client.Do(req)
  1743. }
  1744. // Do executes the "dataproc.projects.clusters.create" call.
  1745. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1746. // status code is an error. Response headers are in either
  1747. // *Operation.ServerResponse.Header or (if a response was returned at
  1748. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1749. // to check whether the returned error was because
  1750. // http.StatusNotModified was returned.
  1751. func (c *ProjectsClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1752. gensupport.SetOptions(c.urlParams_, opts...)
  1753. res, err := c.doRequest("json")
  1754. if res != nil && res.StatusCode == http.StatusNotModified {
  1755. if res.Body != nil {
  1756. res.Body.Close()
  1757. }
  1758. return nil, &googleapi.Error{
  1759. Code: res.StatusCode,
  1760. Header: res.Header,
  1761. }
  1762. }
  1763. if err != nil {
  1764. return nil, err
  1765. }
  1766. defer googleapi.CloseBody(res)
  1767. if err := googleapi.CheckResponse(res); err != nil {
  1768. return nil, err
  1769. }
  1770. ret := &Operation{
  1771. ServerResponse: googleapi.ServerResponse{
  1772. Header: res.Header,
  1773. HTTPStatusCode: res.StatusCode,
  1774. },
  1775. }
  1776. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1777. return nil, err
  1778. }
  1779. return ret, nil
  1780. // {
  1781. // "description": "Creates a cluster in a project.",
  1782. // "httpMethod": "POST",
  1783. // "id": "dataproc.projects.clusters.create",
  1784. // "parameterOrder": [
  1785. // "projectId"
  1786. // ],
  1787. // "parameters": {
  1788. // "projectId": {
  1789. // "description": "[Required] The ID of the Google Cloud Platform project that the cluster belongs to.",
  1790. // "location": "path",
  1791. // "required": true,
  1792. // "type": "string"
  1793. // }
  1794. // },
  1795. // "path": "v1beta1/projects/{projectId}/clusters",
  1796. // "request": {
  1797. // "$ref": "Cluster"
  1798. // },
  1799. // "response": {
  1800. // "$ref": "Operation"
  1801. // },
  1802. // "scopes": [
  1803. // "https://www.googleapis.com/auth/cloud-platform"
  1804. // ]
  1805. // }
  1806. }
  1807. // method id "dataproc.projects.clusters.delete":
  1808. type ProjectsClustersDeleteCall struct {
  1809. s *Service
  1810. projectId string
  1811. clusterName string
  1812. urlParams_ gensupport.URLParams
  1813. ctx_ context.Context
  1814. }
  1815. // Delete: Deletes a cluster in a project.
  1816. func (r *ProjectsClustersService) Delete(projectId string, clusterName string) *ProjectsClustersDeleteCall {
  1817. c := &ProjectsClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1818. c.projectId = projectId
  1819. c.clusterName = clusterName
  1820. return c
  1821. }
  1822. // Fields allows partial responses to be retrieved. See
  1823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1824. // for more information.
  1825. func (c *ProjectsClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsClustersDeleteCall {
  1826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1827. return c
  1828. }
  1829. // Context sets the context to be used in this call's Do method. Any
  1830. // pending HTTP request will be aborted if the provided context is
  1831. // canceled.
  1832. func (c *ProjectsClustersDeleteCall) Context(ctx context.Context) *ProjectsClustersDeleteCall {
  1833. c.ctx_ = ctx
  1834. return c
  1835. }
  1836. func (c *ProjectsClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  1837. var body io.Reader = nil
  1838. c.urlParams_.Set("alt", alt)
  1839. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/clusters/{clusterName}")
  1840. urls += "?" + c.urlParams_.Encode()
  1841. req, _ := http.NewRequest("DELETE", urls, body)
  1842. googleapi.Expand(req.URL, map[string]string{
  1843. "projectId": c.projectId,
  1844. "clusterName": c.clusterName,
  1845. })
  1846. req.Header.Set("User-Agent", c.s.userAgent())
  1847. if c.ctx_ != nil {
  1848. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1849. }
  1850. return c.s.client.Do(req)
  1851. }
  1852. // Do executes the "dataproc.projects.clusters.delete" call.
  1853. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1854. // status code is an error. Response headers are in either
  1855. // *Operation.ServerResponse.Header or (if a response was returned at
  1856. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1857. // to check whether the returned error was because
  1858. // http.StatusNotModified was returned.
  1859. func (c *ProjectsClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1860. gensupport.SetOptions(c.urlParams_, opts...)
  1861. res, err := c.doRequest("json")
  1862. if res != nil && res.StatusCode == http.StatusNotModified {
  1863. if res.Body != nil {
  1864. res.Body.Close()
  1865. }
  1866. return nil, &googleapi.Error{
  1867. Code: res.StatusCode,
  1868. Header: res.Header,
  1869. }
  1870. }
  1871. if err != nil {
  1872. return nil, err
  1873. }
  1874. defer googleapi.CloseBody(res)
  1875. if err := googleapi.CheckResponse(res); err != nil {
  1876. return nil, err
  1877. }
  1878. ret := &Operation{
  1879. ServerResponse: googleapi.ServerResponse{
  1880. Header: res.Header,
  1881. HTTPStatusCode: res.StatusCode,
  1882. },
  1883. }
  1884. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1885. return nil, err
  1886. }
  1887. return ret, nil
  1888. // {
  1889. // "description": "Deletes a cluster in a project.",
  1890. // "httpMethod": "DELETE",
  1891. // "id": "dataproc.projects.clusters.delete",
  1892. // "parameterOrder": [
  1893. // "projectId",
  1894. // "clusterName"
  1895. // ],
  1896. // "parameters": {
  1897. // "clusterName": {
  1898. // "description": "[Required] The cluster name.",
  1899. // "location": "path",
  1900. // "required": true,
  1901. // "type": "string"
  1902. // },
  1903. // "projectId": {
  1904. // "description": "[Required] The ID of the Google Cloud Platform project that the cluster belongs to.",
  1905. // "location": "path",
  1906. // "required": true,
  1907. // "type": "string"
  1908. // }
  1909. // },
  1910. // "path": "v1beta1/projects/{projectId}/clusters/{clusterName}",
  1911. // "response": {
  1912. // "$ref": "Operation"
  1913. // },
  1914. // "scopes": [
  1915. // "https://www.googleapis.com/auth/cloud-platform"
  1916. // ]
  1917. // }
  1918. }
  1919. // method id "dataproc.projects.clusters.diagnose":
  1920. type ProjectsClustersDiagnoseCall struct {
  1921. s *Service
  1922. projectId string
  1923. clusterName string
  1924. diagnoseclusterrequest *DiagnoseClusterRequest
  1925. urlParams_ gensupport.URLParams
  1926. ctx_ context.Context
  1927. }
  1928. // Diagnose: Gets cluster diagnostic information. After the operation
  1929. // completes, the Operation.response field contains
  1930. // `DiagnoseClusterOutputLocation`.
  1931. func (r *ProjectsClustersService) Diagnose(projectId string, clusterName string, diagnoseclusterrequest *DiagnoseClusterRequest) *ProjectsClustersDiagnoseCall {
  1932. c := &ProjectsClustersDiagnoseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1933. c.projectId = projectId
  1934. c.clusterName = clusterName
  1935. c.diagnoseclusterrequest = diagnoseclusterrequest
  1936. return c
  1937. }
  1938. // Fields allows partial responses to be retrieved. See
  1939. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1940. // for more information.
  1941. func (c *ProjectsClustersDiagnoseCall) Fields(s ...googleapi.Field) *ProjectsClustersDiagnoseCall {
  1942. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1943. return c
  1944. }
  1945. // Context sets the context to be used in this call's Do method. Any
  1946. // pending HTTP request will be aborted if the provided context is
  1947. // canceled.
  1948. func (c *ProjectsClustersDiagnoseCall) Context(ctx context.Context) *ProjectsClustersDiagnoseCall {
  1949. c.ctx_ = ctx
  1950. return c
  1951. }
  1952. func (c *ProjectsClustersDiagnoseCall) doRequest(alt string) (*http.Response, error) {
  1953. var body io.Reader = nil
  1954. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diagnoseclusterrequest)
  1955. if err != nil {
  1956. return nil, err
  1957. }
  1958. ctype := "application/json"
  1959. c.urlParams_.Set("alt", alt)
  1960. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/clusters/{clusterName}:diagnose")
  1961. urls += "?" + c.urlParams_.Encode()
  1962. req, _ := http.NewRequest("POST", urls, body)
  1963. googleapi.Expand(req.URL, map[string]string{
  1964. "projectId": c.projectId,
  1965. "clusterName": c.clusterName,
  1966. })
  1967. req.Header.Set("Content-Type", ctype)
  1968. req.Header.Set("User-Agent", c.s.userAgent())
  1969. if c.ctx_ != nil {
  1970. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1971. }
  1972. return c.s.client.Do(req)
  1973. }
  1974. // Do executes the "dataproc.projects.clusters.diagnose" call.
  1975. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1976. // status code is an error. Response headers are in either
  1977. // *Operation.ServerResponse.Header or (if a response was returned at
  1978. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1979. // to check whether the returned error was because
  1980. // http.StatusNotModified was returned.
  1981. func (c *ProjectsClustersDiagnoseCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1982. gensupport.SetOptions(c.urlParams_, opts...)
  1983. res, err := c.doRequest("json")
  1984. if res != nil && res.StatusCode == http.StatusNotModified {
  1985. if res.Body != nil {
  1986. res.Body.Close()
  1987. }
  1988. return nil, &googleapi.Error{
  1989. Code: res.StatusCode,
  1990. Header: res.Header,
  1991. }
  1992. }
  1993. if err != nil {
  1994. return nil, err
  1995. }
  1996. defer googleapi.CloseBody(res)
  1997. if err := googleapi.CheckResponse(res); err != nil {
  1998. return nil, err
  1999. }
  2000. ret := &Operation{
  2001. ServerResponse: googleapi.ServerResponse{
  2002. Header: res.Header,
  2003. HTTPStatusCode: res.StatusCode,
  2004. },
  2005. }
  2006. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2007. return nil, err
  2008. }
  2009. return ret, nil
  2010. // {
  2011. // "description": "Gets cluster diagnostic information. After the operation completes, the Operation.response field contains `DiagnoseClusterOutputLocation`.",
  2012. // "httpMethod": "POST",
  2013. // "id": "dataproc.projects.clusters.diagnose",
  2014. // "parameterOrder": [
  2015. // "projectId",
  2016. // "clusterName"
  2017. // ],
  2018. // "parameters": {
  2019. // "clusterName": {
  2020. // "description": "[Required] The cluster name.",
  2021. // "location": "path",
  2022. // "required": true,
  2023. // "type": "string"
  2024. // },
  2025. // "projectId": {
  2026. // "description": "[Required] The ID of the Google Cloud Platform project that the cluster belongs to.",
  2027. // "location": "path",
  2028. // "required": true,
  2029. // "type": "string"
  2030. // }
  2031. // },
  2032. // "path": "v1beta1/projects/{projectId}/clusters/{clusterName}:diagnose",
  2033. // "request": {
  2034. // "$ref": "DiagnoseClusterRequest"
  2035. // },
  2036. // "response": {
  2037. // "$ref": "Operation"
  2038. // },
  2039. // "scopes": [
  2040. // "https://www.googleapis.com/auth/cloud-platform"
  2041. // ]
  2042. // }
  2043. }
  2044. // method id "dataproc.projects.clusters.get":
  2045. type ProjectsClustersGetCall struct {
  2046. s *Service
  2047. projectId string
  2048. clusterName string
  2049. urlParams_ gensupport.URLParams
  2050. ifNoneMatch_ string
  2051. ctx_ context.Context
  2052. }
  2053. // Get: Gets the resource representation for a cluster in a project.
  2054. func (r *ProjectsClustersService) Get(projectId string, clusterName string) *ProjectsClustersGetCall {
  2055. c := &ProjectsClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2056. c.projectId = projectId
  2057. c.clusterName = clusterName
  2058. return c
  2059. }
  2060. // Fields allows partial responses to be retrieved. See
  2061. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2062. // for more information.
  2063. func (c *ProjectsClustersGetCall) Fields(s ...googleapi.Field) *ProjectsClustersGetCall {
  2064. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2065. return c
  2066. }
  2067. // IfNoneMatch sets the optional parameter which makes the operation
  2068. // fail if the object's ETag matches the given value. This is useful for
  2069. // getting updates only after the object has changed since the last
  2070. // request. Use googleapi.IsNotModified to check whether the response
  2071. // error from Do is the result of In-None-Match.
  2072. func (c *ProjectsClustersGetCall) IfNoneMatch(entityTag string) *ProjectsClustersGetCall {
  2073. c.ifNoneMatch_ = entityTag
  2074. return c
  2075. }
  2076. // Context sets the context to be used in this call's Do method. Any
  2077. // pending HTTP request will be aborted if the provided context is
  2078. // canceled.
  2079. func (c *ProjectsClustersGetCall) Context(ctx context.Context) *ProjectsClustersGetCall {
  2080. c.ctx_ = ctx
  2081. return c
  2082. }
  2083. func (c *ProjectsClustersGetCall) doRequest(alt string) (*http.Response, error) {
  2084. var body io.Reader = nil
  2085. c.urlParams_.Set("alt", alt)
  2086. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/clusters/{clusterName}")
  2087. urls += "?" + c.urlParams_.Encode()
  2088. req, _ := http.NewRequest("GET", urls, body)
  2089. googleapi.Expand(req.URL, map[string]string{
  2090. "projectId": c.projectId,
  2091. "clusterName": c.clusterName,
  2092. })
  2093. req.Header.Set("User-Agent", c.s.userAgent())
  2094. if c.ifNoneMatch_ != "" {
  2095. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2096. }
  2097. if c.ctx_ != nil {
  2098. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2099. }
  2100. return c.s.client.Do(req)
  2101. }
  2102. // Do executes the "dataproc.projects.clusters.get" call.
  2103. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  2104. // code is an error. Response headers are in either
  2105. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  2106. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2107. // check whether the returned error was because http.StatusNotModified
  2108. // was returned.
  2109. func (c *ProjectsClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  2110. gensupport.SetOptions(c.urlParams_, opts...)
  2111. res, err := c.doRequest("json")
  2112. if res != nil && res.StatusCode == http.StatusNotModified {
  2113. if res.Body != nil {
  2114. res.Body.Close()
  2115. }
  2116. return nil, &googleapi.Error{
  2117. Code: res.StatusCode,
  2118. Header: res.Header,
  2119. }
  2120. }
  2121. if err != nil {
  2122. return nil, err
  2123. }
  2124. defer googleapi.CloseBody(res)
  2125. if err := googleapi.CheckResponse(res); err != nil {
  2126. return nil, err
  2127. }
  2128. ret := &Cluster{
  2129. ServerResponse: googleapi.ServerResponse{
  2130. Header: res.Header,
  2131. HTTPStatusCode: res.StatusCode,
  2132. },
  2133. }
  2134. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2135. return nil, err
  2136. }
  2137. return ret, nil
  2138. // {
  2139. // "description": "Gets the resource representation for a cluster in a project.",
  2140. // "httpMethod": "GET",
  2141. // "id": "dataproc.projects.clusters.get",
  2142. // "parameterOrder": [
  2143. // "projectId",
  2144. // "clusterName"
  2145. // ],
  2146. // "parameters": {
  2147. // "clusterName": {
  2148. // "description": "[Required] The cluster name.",
  2149. // "location": "path",
  2150. // "required": true,
  2151. // "type": "string"
  2152. // },
  2153. // "projectId": {
  2154. // "description": "[Required] The ID of the Google Cloud Platform project that the cluster belongs to.",
  2155. // "location": "path",
  2156. // "required": true,
  2157. // "type": "string"
  2158. // }
  2159. // },
  2160. // "path": "v1beta1/projects/{projectId}/clusters/{clusterName}",
  2161. // "response": {
  2162. // "$ref": "Cluster"
  2163. // },
  2164. // "scopes": [
  2165. // "https://www.googleapis.com/auth/cloud-platform"
  2166. // ]
  2167. // }
  2168. }
  2169. // method id "dataproc.projects.clusters.list":
  2170. type ProjectsClustersListCall struct {
  2171. s *Service
  2172. projectId string
  2173. urlParams_ gensupport.URLParams
  2174. ifNoneMatch_ string
  2175. ctx_ context.Context
  2176. }
  2177. // List: Lists all clusters in a project.
  2178. func (r *ProjectsClustersService) List(projectId string) *ProjectsClustersListCall {
  2179. c := &ProjectsClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2180. c.projectId = projectId
  2181. return c
  2182. }
  2183. // PageSize sets the optional parameter "pageSize": The standard List
  2184. // page size.
  2185. func (c *ProjectsClustersListCall) PageSize(pageSize int64) *ProjectsClustersListCall {
  2186. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2187. return c
  2188. }
  2189. // PageToken sets the optional parameter "pageToken": The standard List
  2190. // page token.
  2191. func (c *ProjectsClustersListCall) PageToken(pageToken string) *ProjectsClustersListCall {
  2192. c.urlParams_.Set("pageToken", pageToken)
  2193. return c
  2194. }
  2195. // Fields allows partial responses to be retrieved. See
  2196. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2197. // for more information.
  2198. func (c *ProjectsClustersListCall) Fields(s ...googleapi.Field) *ProjectsClustersListCall {
  2199. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2200. return c
  2201. }
  2202. // IfNoneMatch sets the optional parameter which makes the operation
  2203. // fail if the object's ETag matches the given value. This is useful for
  2204. // getting updates only after the object has changed since the last
  2205. // request. Use googleapi.IsNotModified to check whether the response
  2206. // error from Do is the result of In-None-Match.
  2207. func (c *ProjectsClustersListCall) IfNoneMatch(entityTag string) *ProjectsClustersListCall {
  2208. c.ifNoneMatch_ = entityTag
  2209. return c
  2210. }
  2211. // Context sets the context to be used in this call's Do method. Any
  2212. // pending HTTP request will be aborted if the provided context is
  2213. // canceled.
  2214. func (c *ProjectsClustersListCall) Context(ctx context.Context) *ProjectsClustersListCall {
  2215. c.ctx_ = ctx
  2216. return c
  2217. }
  2218. func (c *ProjectsClustersListCall) doRequest(alt string) (*http.Response, error) {
  2219. var body io.Reader = nil
  2220. c.urlParams_.Set("alt", alt)
  2221. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/clusters")
  2222. urls += "?" + c.urlParams_.Encode()
  2223. req, _ := http.NewRequest("GET", urls, body)
  2224. googleapi.Expand(req.URL, map[string]string{
  2225. "projectId": c.projectId,
  2226. })
  2227. req.Header.Set("User-Agent", c.s.userAgent())
  2228. if c.ifNoneMatch_ != "" {
  2229. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2230. }
  2231. if c.ctx_ != nil {
  2232. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2233. }
  2234. return c.s.client.Do(req)
  2235. }
  2236. // Do executes the "dataproc.projects.clusters.list" call.
  2237. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  2238. // non-2xx status code is an error. Response headers are in either
  2239. // *ListClustersResponse.ServerResponse.Header or (if a response was
  2240. // returned at all) in error.(*googleapi.Error).Header. Use
  2241. // googleapi.IsNotModified to check whether the returned error was
  2242. // because http.StatusNotModified was returned.
  2243. func (c *ProjectsClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  2244. gensupport.SetOptions(c.urlParams_, opts...)
  2245. res, err := c.doRequest("json")
  2246. if res != nil && res.StatusCode == http.StatusNotModified {
  2247. if res.Body != nil {
  2248. res.Body.Close()
  2249. }
  2250. return nil, &googleapi.Error{
  2251. Code: res.StatusCode,
  2252. Header: res.Header,
  2253. }
  2254. }
  2255. if err != nil {
  2256. return nil, err
  2257. }
  2258. defer googleapi.CloseBody(res)
  2259. if err := googleapi.CheckResponse(res); err != nil {
  2260. return nil, err
  2261. }
  2262. ret := &ListClustersResponse{
  2263. ServerResponse: googleapi.ServerResponse{
  2264. Header: res.Header,
  2265. HTTPStatusCode: res.StatusCode,
  2266. },
  2267. }
  2268. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2269. return nil, err
  2270. }
  2271. return ret, nil
  2272. // {
  2273. // "description": "Lists all clusters in a project.",
  2274. // "httpMethod": "GET",
  2275. // "id": "dataproc.projects.clusters.list",
  2276. // "parameterOrder": [
  2277. // "projectId"
  2278. // ],
  2279. // "parameters": {
  2280. // "pageSize": {
  2281. // "description": "The standard List page size.",
  2282. // "format": "int32",
  2283. // "location": "query",
  2284. // "type": "integer"
  2285. // },
  2286. // "pageToken": {
  2287. // "description": "The standard List page token.",
  2288. // "location": "query",
  2289. // "type": "string"
  2290. // },
  2291. // "projectId": {
  2292. // "description": "[Required] The ID of the Google Cloud Platform project that the cluster belongs to.",
  2293. // "location": "path",
  2294. // "required": true,
  2295. // "type": "string"
  2296. // }
  2297. // },
  2298. // "path": "v1beta1/projects/{projectId}/clusters",
  2299. // "response": {
  2300. // "$ref": "ListClustersResponse"
  2301. // },
  2302. // "scopes": [
  2303. // "https://www.googleapis.com/auth/cloud-platform"
  2304. // ]
  2305. // }
  2306. }
  2307. // Pages invokes f for each page of results.
  2308. // A non-nil error returned from f will halt the iteration.
  2309. // The provided context supersedes any context provided to the Context method.
  2310. func (c *ProjectsClustersListCall) Pages(ctx context.Context, f func(*ListClustersResponse) error) error {
  2311. c.ctx_ = ctx
  2312. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2313. for {
  2314. x, err := c.Do()
  2315. if err != nil {
  2316. return err
  2317. }
  2318. if err := f(x); err != nil {
  2319. return err
  2320. }
  2321. if x.NextPageToken == "" {
  2322. return nil
  2323. }
  2324. c.PageToken(x.NextPageToken)
  2325. }
  2326. }
  2327. // method id "dataproc.projects.clusters.patch":
  2328. type ProjectsClustersPatchCall struct {
  2329. s *Service
  2330. projectId string
  2331. clusterName string
  2332. cluster *Cluster
  2333. urlParams_ gensupport.URLParams
  2334. ctx_ context.Context
  2335. }
  2336. // Patch: Updates a cluster in a project.
  2337. func (r *ProjectsClustersService) Patch(projectId string, clusterName string, cluster *Cluster) *ProjectsClustersPatchCall {
  2338. c := &ProjectsClustersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2339. c.projectId = projectId
  2340. c.clusterName = clusterName
  2341. c.cluster = cluster
  2342. return c
  2343. }
  2344. // UpdateMask sets the optional parameter "updateMask": [Required]
  2345. // Specifies the path, relative to Cluster, of the field to update. For
  2346. // example, to change the number of workers in a cluster to 5, the
  2347. // update_mask parameter would be specified as
  2348. // configuration.worker_configuration.num_instances, and the `PATCH`
  2349. // request body would specify the new value, as follows: {
  2350. // "configuration":{ "workerConfiguration":{ "numInstances":"5" } } }
  2351. // Note: Currently, configuration.worker_configuration.num_instances is
  2352. // the only field that can be updated.
  2353. func (c *ProjectsClustersPatchCall) UpdateMask(updateMask string) *ProjectsClustersPatchCall {
  2354. c.urlParams_.Set("updateMask", updateMask)
  2355. return c
  2356. }
  2357. // Fields allows partial responses to be retrieved. See
  2358. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2359. // for more information.
  2360. func (c *ProjectsClustersPatchCall) Fields(s ...googleapi.Field) *ProjectsClustersPatchCall {
  2361. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2362. return c
  2363. }
  2364. // Context sets the context to be used in this call's Do method. Any
  2365. // pending HTTP request will be aborted if the provided context is
  2366. // canceled.
  2367. func (c *ProjectsClustersPatchCall) Context(ctx context.Context) *ProjectsClustersPatchCall {
  2368. c.ctx_ = ctx
  2369. return c
  2370. }
  2371. func (c *ProjectsClustersPatchCall) doRequest(alt string) (*http.Response, error) {
  2372. var body io.Reader = nil
  2373. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster)
  2374. if err != nil {
  2375. return nil, err
  2376. }
  2377. ctype := "application/json"
  2378. c.urlParams_.Set("alt", alt)
  2379. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/clusters/{clusterName}")
  2380. urls += "?" + c.urlParams_.Encode()
  2381. req, _ := http.NewRequest("PATCH", urls, body)
  2382. googleapi.Expand(req.URL, map[string]string{
  2383. "projectId": c.projectId,
  2384. "clusterName": c.clusterName,
  2385. })
  2386. req.Header.Set("Content-Type", ctype)
  2387. req.Header.Set("User-Agent", c.s.userAgent())
  2388. if c.ctx_ != nil {
  2389. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2390. }
  2391. return c.s.client.Do(req)
  2392. }
  2393. // Do executes the "dataproc.projects.clusters.patch" call.
  2394. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2395. // status code is an error. Response headers are in either
  2396. // *Operation.ServerResponse.Header or (if a response was returned at
  2397. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2398. // to check whether the returned error was because
  2399. // http.StatusNotModified was returned.
  2400. func (c *ProjectsClustersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2401. gensupport.SetOptions(c.urlParams_, opts...)
  2402. res, err := c.doRequest("json")
  2403. if res != nil && res.StatusCode == http.StatusNotModified {
  2404. if res.Body != nil {
  2405. res.Body.Close()
  2406. }
  2407. return nil, &googleapi.Error{
  2408. Code: res.StatusCode,
  2409. Header: res.Header,
  2410. }
  2411. }
  2412. if err != nil {
  2413. return nil, err
  2414. }
  2415. defer googleapi.CloseBody(res)
  2416. if err := googleapi.CheckResponse(res); err != nil {
  2417. return nil, err
  2418. }
  2419. ret := &Operation{
  2420. ServerResponse: googleapi.ServerResponse{
  2421. Header: res.Header,
  2422. HTTPStatusCode: res.StatusCode,
  2423. },
  2424. }
  2425. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2426. return nil, err
  2427. }
  2428. return ret, nil
  2429. // {
  2430. // "description": "Updates a cluster in a project.",
  2431. // "httpMethod": "PATCH",
  2432. // "id": "dataproc.projects.clusters.patch",
  2433. // "parameterOrder": [
  2434. // "projectId",
  2435. // "clusterName"
  2436. // ],
  2437. // "parameters": {
  2438. // "clusterName": {
  2439. // "description": "[Required] The cluster name.",
  2440. // "location": "path",
  2441. // "required": true,
  2442. // "type": "string"
  2443. // },
  2444. // "projectId": {
  2445. // "description": "[Required] The ID of the Google Cloud Platform project the cluster belongs to.",
  2446. // "location": "path",
  2447. // "required": true,
  2448. // "type": "string"
  2449. // },
  2450. // "updateMask": {
  2451. // "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.",
  2452. // "location": "query",
  2453. // "type": "string"
  2454. // }
  2455. // },
  2456. // "path": "v1beta1/projects/{projectId}/clusters/{clusterName}",
  2457. // "request": {
  2458. // "$ref": "Cluster"
  2459. // },
  2460. // "response": {
  2461. // "$ref": "Operation"
  2462. // },
  2463. // "scopes": [
  2464. // "https://www.googleapis.com/auth/cloud-platform"
  2465. // ]
  2466. // }
  2467. }
  2468. // method id "dataproc.projects.jobs.cancel":
  2469. type ProjectsJobsCancelCall struct {
  2470. s *Service
  2471. projectId string
  2472. jobId string
  2473. canceljobrequest *CancelJobRequest
  2474. urlParams_ gensupport.URLParams
  2475. ctx_ context.Context
  2476. }
  2477. // Cancel: Starts a job cancellation request. To access the job resource
  2478. // after cancellation, call
  2479. // [jobs.list](/dataproc/reference/rest/v1beta1/projects.jobs/list) or
  2480. // [jobs.get](/dataproc/reference/rest/v1beta1/projects.jobs/get).
  2481. func (r *ProjectsJobsService) Cancel(projectId string, jobId string, canceljobrequest *CancelJobRequest) *ProjectsJobsCancelCall {
  2482. c := &ProjectsJobsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2483. c.projectId = projectId
  2484. c.jobId = jobId
  2485. c.canceljobrequest = canceljobrequest
  2486. return c
  2487. }
  2488. // Fields allows partial responses to be retrieved. See
  2489. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2490. // for more information.
  2491. func (c *ProjectsJobsCancelCall) Fields(s ...googleapi.Field) *ProjectsJobsCancelCall {
  2492. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2493. return c
  2494. }
  2495. // Context sets the context to be used in this call's Do method. Any
  2496. // pending HTTP request will be aborted if the provided context is
  2497. // canceled.
  2498. func (c *ProjectsJobsCancelCall) Context(ctx context.Context) *ProjectsJobsCancelCall {
  2499. c.ctx_ = ctx
  2500. return c
  2501. }
  2502. func (c *ProjectsJobsCancelCall) doRequest(alt string) (*http.Response, error) {
  2503. var body io.Reader = nil
  2504. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceljobrequest)
  2505. if err != nil {
  2506. return nil, err
  2507. }
  2508. ctype := "application/json"
  2509. c.urlParams_.Set("alt", alt)
  2510. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/jobs/{jobId}:cancel")
  2511. urls += "?" + c.urlParams_.Encode()
  2512. req, _ := http.NewRequest("POST", urls, body)
  2513. googleapi.Expand(req.URL, map[string]string{
  2514. "projectId": c.projectId,
  2515. "jobId": c.jobId,
  2516. })
  2517. req.Header.Set("Content-Type", ctype)
  2518. req.Header.Set("User-Agent", c.s.userAgent())
  2519. if c.ctx_ != nil {
  2520. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2521. }
  2522. return c.s.client.Do(req)
  2523. }
  2524. // Do executes the "dataproc.projects.jobs.cancel" call.
  2525. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  2526. // is an error. Response headers are in either
  2527. // *Job.ServerResponse.Header or (if a response was returned at all) in
  2528. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2529. // whether the returned error was because http.StatusNotModified was
  2530. // returned.
  2531. func (c *ProjectsJobsCancelCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  2532. gensupport.SetOptions(c.urlParams_, opts...)
  2533. res, err := c.doRequest("json")
  2534. if res != nil && res.StatusCode == http.StatusNotModified {
  2535. if res.Body != nil {
  2536. res.Body.Close()
  2537. }
  2538. return nil, &googleapi.Error{
  2539. Code: res.StatusCode,
  2540. Header: res.Header,
  2541. }
  2542. }
  2543. if err != nil {
  2544. return nil, err
  2545. }
  2546. defer googleapi.CloseBody(res)
  2547. if err := googleapi.CheckResponse(res); err != nil {
  2548. return nil, err
  2549. }
  2550. ret := &Job{
  2551. ServerResponse: googleapi.ServerResponse{
  2552. Header: res.Header,
  2553. HTTPStatusCode: res.StatusCode,
  2554. },
  2555. }
  2556. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2557. return nil, err
  2558. }
  2559. return ret, nil
  2560. // {
  2561. // "description": "Starts a job cancellation request. To access the job resource after cancellation, call [jobs.list](/dataproc/reference/rest/v1beta1/projects.jobs/list) or [jobs.get](/dataproc/reference/rest/v1beta1/projects.jobs/get).",
  2562. // "httpMethod": "POST",
  2563. // "id": "dataproc.projects.jobs.cancel",
  2564. // "parameterOrder": [
  2565. // "projectId",
  2566. // "jobId"
  2567. // ],
  2568. // "parameters": {
  2569. // "jobId": {
  2570. // "description": "[Required] The job ID.",
  2571. // "location": "path",
  2572. // "required": true,
  2573. // "type": "string"
  2574. // },
  2575. // "projectId": {
  2576. // "description": "[Required] The ID of the Google Cloud Platform project that the job belongs to.",
  2577. // "location": "path",
  2578. // "required": true,
  2579. // "type": "string"
  2580. // }
  2581. // },
  2582. // "path": "v1beta1/projects/{projectId}/jobs/{jobId}:cancel",
  2583. // "request": {
  2584. // "$ref": "CancelJobRequest"
  2585. // },
  2586. // "response": {
  2587. // "$ref": "Job"
  2588. // },
  2589. // "scopes": [
  2590. // "https://www.googleapis.com/auth/cloud-platform"
  2591. // ]
  2592. // }
  2593. }
  2594. // method id "dataproc.projects.jobs.delete":
  2595. type ProjectsJobsDeleteCall struct {
  2596. s *Service
  2597. projectId string
  2598. jobId string
  2599. urlParams_ gensupport.URLParams
  2600. ctx_ context.Context
  2601. }
  2602. // Delete: Deletes the job from the project. If the job is active, the
  2603. // delete fails, and the response returns `FAILED_PRECONDITION`.
  2604. func (r *ProjectsJobsService) Delete(projectId string, jobId string) *ProjectsJobsDeleteCall {
  2605. c := &ProjectsJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2606. c.projectId = projectId
  2607. c.jobId = jobId
  2608. return c
  2609. }
  2610. // Fields allows partial responses to be retrieved. See
  2611. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2612. // for more information.
  2613. func (c *ProjectsJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsJobsDeleteCall {
  2614. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2615. return c
  2616. }
  2617. // Context sets the context to be used in this call's Do method. Any
  2618. // pending HTTP request will be aborted if the provided context is
  2619. // canceled.
  2620. func (c *ProjectsJobsDeleteCall) Context(ctx context.Context) *ProjectsJobsDeleteCall {
  2621. c.ctx_ = ctx
  2622. return c
  2623. }
  2624. func (c *ProjectsJobsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2625. var body io.Reader = nil
  2626. c.urlParams_.Set("alt", alt)
  2627. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/jobs/{jobId}")
  2628. urls += "?" + c.urlParams_.Encode()
  2629. req, _ := http.NewRequest("DELETE", urls, body)
  2630. googleapi.Expand(req.URL, map[string]string{
  2631. "projectId": c.projectId,
  2632. "jobId": c.jobId,
  2633. })
  2634. req.Header.Set("User-Agent", c.s.userAgent())
  2635. if c.ctx_ != nil {
  2636. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2637. }
  2638. return c.s.client.Do(req)
  2639. }
  2640. // Do executes the "dataproc.projects.jobs.delete" call.
  2641. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2642. // code is an error. Response headers are in either
  2643. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2644. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2645. // check whether the returned error was because http.StatusNotModified
  2646. // was returned.
  2647. func (c *ProjectsJobsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2648. gensupport.SetOptions(c.urlParams_, opts...)
  2649. res, err := c.doRequest("json")
  2650. if res != nil && res.StatusCode == http.StatusNotModified {
  2651. if res.Body != nil {
  2652. res.Body.Close()
  2653. }
  2654. return nil, &googleapi.Error{
  2655. Code: res.StatusCode,
  2656. Header: res.Header,
  2657. }
  2658. }
  2659. if err != nil {
  2660. return nil, err
  2661. }
  2662. defer googleapi.CloseBody(res)
  2663. if err := googleapi.CheckResponse(res); err != nil {
  2664. return nil, err
  2665. }
  2666. ret := &Empty{
  2667. ServerResponse: googleapi.ServerResponse{
  2668. Header: res.Header,
  2669. HTTPStatusCode: res.StatusCode,
  2670. },
  2671. }
  2672. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2673. return nil, err
  2674. }
  2675. return ret, nil
  2676. // {
  2677. // "description": "Deletes the job from the project. If the job is active, the delete fails, and the response returns `FAILED_PRECONDITION`.",
  2678. // "httpMethod": "DELETE",
  2679. // "id": "dataproc.projects.jobs.delete",
  2680. // "parameterOrder": [
  2681. // "projectId",
  2682. // "jobId"
  2683. // ],
  2684. // "parameters": {
  2685. // "jobId": {
  2686. // "description": "[Required] The job ID.",
  2687. // "location": "path",
  2688. // "required": true,
  2689. // "type": "string"
  2690. // },
  2691. // "projectId": {
  2692. // "description": "[Required] The ID of the Google Cloud Platform project that the job belongs to.",
  2693. // "location": "path",
  2694. // "required": true,
  2695. // "type": "string"
  2696. // }
  2697. // },
  2698. // "path": "v1beta1/projects/{projectId}/jobs/{jobId}",
  2699. // "response": {
  2700. // "$ref": "Empty"
  2701. // },
  2702. // "scopes": [
  2703. // "https://www.googleapis.com/auth/cloud-platform"
  2704. // ]
  2705. // }
  2706. }
  2707. // method id "dataproc.projects.jobs.get":
  2708. type ProjectsJobsGetCall struct {
  2709. s *Service
  2710. projectId string
  2711. jobId string
  2712. urlParams_ gensupport.URLParams
  2713. ifNoneMatch_ string
  2714. ctx_ context.Context
  2715. }
  2716. // Get: Gets the resource representation for a job in a project.
  2717. func (r *ProjectsJobsService) Get(projectId string, jobId string) *ProjectsJobsGetCall {
  2718. c := &ProjectsJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2719. c.projectId = projectId
  2720. c.jobId = jobId
  2721. return c
  2722. }
  2723. // Fields allows partial responses to be retrieved. See
  2724. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2725. // for more information.
  2726. func (c *ProjectsJobsGetCall) Fields(s ...googleapi.Field) *ProjectsJobsGetCall {
  2727. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2728. return c
  2729. }
  2730. // IfNoneMatch sets the optional parameter which makes the operation
  2731. // fail if the object's ETag matches the given value. This is useful for
  2732. // getting updates only after the object has changed since the last
  2733. // request. Use googleapi.IsNotModified to check whether the response
  2734. // error from Do is the result of In-None-Match.
  2735. func (c *ProjectsJobsGetCall) IfNoneMatch(entityTag string) *ProjectsJobsGetCall {
  2736. c.ifNoneMatch_ = entityTag
  2737. return c
  2738. }
  2739. // Context sets the context to be used in this call's Do method. Any
  2740. // pending HTTP request will be aborted if the provided context is
  2741. // canceled.
  2742. func (c *ProjectsJobsGetCall) Context(ctx context.Context) *ProjectsJobsGetCall {
  2743. c.ctx_ = ctx
  2744. return c
  2745. }
  2746. func (c *ProjectsJobsGetCall) doRequest(alt string) (*http.Response, error) {
  2747. var body io.Reader = nil
  2748. c.urlParams_.Set("alt", alt)
  2749. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/jobs/{jobId}")
  2750. urls += "?" + c.urlParams_.Encode()
  2751. req, _ := http.NewRequest("GET", urls, body)
  2752. googleapi.Expand(req.URL, map[string]string{
  2753. "projectId": c.projectId,
  2754. "jobId": c.jobId,
  2755. })
  2756. req.Header.Set("User-Agent", c.s.userAgent())
  2757. if c.ifNoneMatch_ != "" {
  2758. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2759. }
  2760. if c.ctx_ != nil {
  2761. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2762. }
  2763. return c.s.client.Do(req)
  2764. }
  2765. // Do executes the "dataproc.projects.jobs.get" call.
  2766. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  2767. // is an error. Response headers are in either
  2768. // *Job.ServerResponse.Header or (if a response was returned at all) in
  2769. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2770. // whether the returned error was because http.StatusNotModified was
  2771. // returned.
  2772. func (c *ProjectsJobsGetCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  2773. gensupport.SetOptions(c.urlParams_, opts...)
  2774. res, err := c.doRequest("json")
  2775. if res != nil && res.StatusCode == http.StatusNotModified {
  2776. if res.Body != nil {
  2777. res.Body.Close()
  2778. }
  2779. return nil, &googleapi.Error{
  2780. Code: res.StatusCode,
  2781. Header: res.Header,
  2782. }
  2783. }
  2784. if err != nil {
  2785. return nil, err
  2786. }
  2787. defer googleapi.CloseBody(res)
  2788. if err := googleapi.CheckResponse(res); err != nil {
  2789. return nil, err
  2790. }
  2791. ret := &Job{
  2792. ServerResponse: googleapi.ServerResponse{
  2793. Header: res.Header,
  2794. HTTPStatusCode: res.StatusCode,
  2795. },
  2796. }
  2797. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2798. return nil, err
  2799. }
  2800. return ret, nil
  2801. // {
  2802. // "description": "Gets the resource representation for a job in a project.",
  2803. // "httpMethod": "GET",
  2804. // "id": "dataproc.projects.jobs.get",
  2805. // "parameterOrder": [
  2806. // "projectId",
  2807. // "jobId"
  2808. // ],
  2809. // "parameters": {
  2810. // "jobId": {
  2811. // "description": "[Required] The job ID.",
  2812. // "location": "path",
  2813. // "required": true,
  2814. // "type": "string"
  2815. // },
  2816. // "projectId": {
  2817. // "description": "[Required] The ID of the Google Cloud Platform project that the job belongs to.",
  2818. // "location": "path",
  2819. // "required": true,
  2820. // "type": "string"
  2821. // }
  2822. // },
  2823. // "path": "v1beta1/projects/{projectId}/jobs/{jobId}",
  2824. // "response": {
  2825. // "$ref": "Job"
  2826. // },
  2827. // "scopes": [
  2828. // "https://www.googleapis.com/auth/cloud-platform"
  2829. // ]
  2830. // }
  2831. }
  2832. // method id "dataproc.projects.jobs.list":
  2833. type ProjectsJobsListCall struct {
  2834. s *Service
  2835. projectId string
  2836. urlParams_ gensupport.URLParams
  2837. ifNoneMatch_ string
  2838. ctx_ context.Context
  2839. }
  2840. // List: Lists jobs in a project.
  2841. func (r *ProjectsJobsService) List(projectId string) *ProjectsJobsListCall {
  2842. c := &ProjectsJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2843. c.projectId = projectId
  2844. return c
  2845. }
  2846. // ClusterName sets the optional parameter "clusterName": [Optional] If
  2847. // set, the returned jobs list includes only jobs that were submitted to
  2848. // the named cluster.
  2849. func (c *ProjectsJobsListCall) ClusterName(clusterName string) *ProjectsJobsListCall {
  2850. c.urlParams_.Set("clusterName", clusterName)
  2851. return c
  2852. }
  2853. // JobStateMatcher sets the optional parameter "jobStateMatcher":
  2854. // [Optional] Specifies enumerated categories of jobs to list.
  2855. //
  2856. // Possible values:
  2857. // "ALL"
  2858. // "ACTIVE"
  2859. // "NON_ACTIVE"
  2860. func (c *ProjectsJobsListCall) JobStateMatcher(jobStateMatcher string) *ProjectsJobsListCall {
  2861. c.urlParams_.Set("jobStateMatcher", jobStateMatcher)
  2862. return c
  2863. }
  2864. // PageSize sets the optional parameter "pageSize": [Optional] The
  2865. // number of results to return in each response.
  2866. func (c *ProjectsJobsListCall) PageSize(pageSize int64) *ProjectsJobsListCall {
  2867. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2868. return c
  2869. }
  2870. // PageToken sets the optional parameter "pageToken": [Optional] The
  2871. // page token, returned by a previous call, to request the next page of
  2872. // results.
  2873. func (c *ProjectsJobsListCall) PageToken(pageToken string) *ProjectsJobsListCall {
  2874. c.urlParams_.Set("pageToken", pageToken)
  2875. return c
  2876. }
  2877. // Fields allows partial responses to be retrieved. See
  2878. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2879. // for more information.
  2880. func (c *ProjectsJobsListCall) Fields(s ...googleapi.Field) *ProjectsJobsListCall {
  2881. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2882. return c
  2883. }
  2884. // IfNoneMatch sets the optional parameter which makes the operation
  2885. // fail if the object's ETag matches the given value. This is useful for
  2886. // getting updates only after the object has changed since the last
  2887. // request. Use googleapi.IsNotModified to check whether the response
  2888. // error from Do is the result of In-None-Match.
  2889. func (c *ProjectsJobsListCall) IfNoneMatch(entityTag string) *ProjectsJobsListCall {
  2890. c.ifNoneMatch_ = entityTag
  2891. return c
  2892. }
  2893. // Context sets the context to be used in this call's Do method. Any
  2894. // pending HTTP request will be aborted if the provided context is
  2895. // canceled.
  2896. func (c *ProjectsJobsListCall) Context(ctx context.Context) *ProjectsJobsListCall {
  2897. c.ctx_ = ctx
  2898. return c
  2899. }
  2900. func (c *ProjectsJobsListCall) doRequest(alt string) (*http.Response, error) {
  2901. var body io.Reader = nil
  2902. c.urlParams_.Set("alt", alt)
  2903. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/jobs")
  2904. urls += "?" + c.urlParams_.Encode()
  2905. req, _ := http.NewRequest("GET", urls, body)
  2906. googleapi.Expand(req.URL, map[string]string{
  2907. "projectId": c.projectId,
  2908. })
  2909. req.Header.Set("User-Agent", c.s.userAgent())
  2910. if c.ifNoneMatch_ != "" {
  2911. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2912. }
  2913. if c.ctx_ != nil {
  2914. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2915. }
  2916. return c.s.client.Do(req)
  2917. }
  2918. // Do executes the "dataproc.projects.jobs.list" call.
  2919. // Exactly one of *ListJobsResponse or error will be non-nil. Any
  2920. // non-2xx status code is an error. Response headers are in either
  2921. // *ListJobsResponse.ServerResponse.Header or (if a response was
  2922. // returned at all) in error.(*googleapi.Error).Header. Use
  2923. // googleapi.IsNotModified to check whether the returned error was
  2924. // because http.StatusNotModified was returned.
  2925. func (c *ProjectsJobsListCall) Do(opts ...googleapi.CallOption) (*ListJobsResponse, error) {
  2926. gensupport.SetOptions(c.urlParams_, opts...)
  2927. res, err := c.doRequest("json")
  2928. if res != nil && res.StatusCode == http.StatusNotModified {
  2929. if res.Body != nil {
  2930. res.Body.Close()
  2931. }
  2932. return nil, &googleapi.Error{
  2933. Code: res.StatusCode,
  2934. Header: res.Header,
  2935. }
  2936. }
  2937. if err != nil {
  2938. return nil, err
  2939. }
  2940. defer googleapi.CloseBody(res)
  2941. if err := googleapi.CheckResponse(res); err != nil {
  2942. return nil, err
  2943. }
  2944. ret := &ListJobsResponse{
  2945. ServerResponse: googleapi.ServerResponse{
  2946. Header: res.Header,
  2947. HTTPStatusCode: res.StatusCode,
  2948. },
  2949. }
  2950. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2951. return nil, err
  2952. }
  2953. return ret, nil
  2954. // {
  2955. // "description": "Lists jobs in a project.",
  2956. // "httpMethod": "GET",
  2957. // "id": "dataproc.projects.jobs.list",
  2958. // "parameterOrder": [
  2959. // "projectId"
  2960. // ],
  2961. // "parameters": {
  2962. // "clusterName": {
  2963. // "description": "[Optional] If set, the returned jobs list includes only jobs that were submitted to the named cluster.",
  2964. // "location": "query",
  2965. // "type": "string"
  2966. // },
  2967. // "jobStateMatcher": {
  2968. // "description": "[Optional] Specifies enumerated categories of jobs to list.",
  2969. // "enum": [
  2970. // "ALL",
  2971. // "ACTIVE",
  2972. // "NON_ACTIVE"
  2973. // ],
  2974. // "location": "query",
  2975. // "type": "string"
  2976. // },
  2977. // "pageSize": {
  2978. // "description": "[Optional] The number of results to return in each response.",
  2979. // "format": "int32",
  2980. // "location": "query",
  2981. // "type": "integer"
  2982. // },
  2983. // "pageToken": {
  2984. // "description": "[Optional] The page token, returned by a previous call, to request the next page of results.",
  2985. // "location": "query",
  2986. // "type": "string"
  2987. // },
  2988. // "projectId": {
  2989. // "description": "[Required] The ID of the Google Cloud Platform project that the job belongs to.",
  2990. // "location": "path",
  2991. // "required": true,
  2992. // "type": "string"
  2993. // }
  2994. // },
  2995. // "path": "v1beta1/projects/{projectId}/jobs",
  2996. // "response": {
  2997. // "$ref": "ListJobsResponse"
  2998. // },
  2999. // "scopes": [
  3000. // "https://www.googleapis.com/auth/cloud-platform"
  3001. // ]
  3002. // }
  3003. }
  3004. // Pages invokes f for each page of results.
  3005. // A non-nil error returned from f will halt the iteration.
  3006. // The provided context supersedes any context provided to the Context method.
  3007. func (c *ProjectsJobsListCall) Pages(ctx context.Context, f func(*ListJobsResponse) error) error {
  3008. c.ctx_ = ctx
  3009. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3010. for {
  3011. x, err := c.Do()
  3012. if err != nil {
  3013. return err
  3014. }
  3015. if err := f(x); err != nil {
  3016. return err
  3017. }
  3018. if x.NextPageToken == "" {
  3019. return nil
  3020. }
  3021. c.PageToken(x.NextPageToken)
  3022. }
  3023. }
  3024. // method id "dataproc.projects.jobs.submit":
  3025. type ProjectsJobsSubmitCall struct {
  3026. s *Service
  3027. projectId string
  3028. submitjobrequest *SubmitJobRequest
  3029. urlParams_ gensupport.URLParams
  3030. ctx_ context.Context
  3031. }
  3032. // Submit: Submits a job to a cluster.
  3033. func (r *ProjectsJobsService) Submit(projectId string, submitjobrequest *SubmitJobRequest) *ProjectsJobsSubmitCall {
  3034. c := &ProjectsJobsSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3035. c.projectId = projectId
  3036. c.submitjobrequest = submitjobrequest
  3037. return c
  3038. }
  3039. // Fields allows partial responses to be retrieved. See
  3040. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3041. // for more information.
  3042. func (c *ProjectsJobsSubmitCall) Fields(s ...googleapi.Field) *ProjectsJobsSubmitCall {
  3043. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3044. return c
  3045. }
  3046. // Context sets the context to be used in this call's Do method. Any
  3047. // pending HTTP request will be aborted if the provided context is
  3048. // canceled.
  3049. func (c *ProjectsJobsSubmitCall) Context(ctx context.Context) *ProjectsJobsSubmitCall {
  3050. c.ctx_ = ctx
  3051. return c
  3052. }
  3053. func (c *ProjectsJobsSubmitCall) doRequest(alt string) (*http.Response, error) {
  3054. var body io.Reader = nil
  3055. body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitjobrequest)
  3056. if err != nil {
  3057. return nil, err
  3058. }
  3059. ctype := "application/json"
  3060. c.urlParams_.Set("alt", alt)
  3061. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}/jobs:submit")
  3062. urls += "?" + c.urlParams_.Encode()
  3063. req, _ := http.NewRequest("POST", urls, body)
  3064. googleapi.Expand(req.URL, map[string]string{
  3065. "projectId": c.projectId,
  3066. })
  3067. req.Header.Set("Content-Type", ctype)
  3068. req.Header.Set("User-Agent", c.s.userAgent())
  3069. if c.ctx_ != nil {
  3070. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3071. }
  3072. return c.s.client.Do(req)
  3073. }
  3074. // Do executes the "dataproc.projects.jobs.submit" call.
  3075. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  3076. // is an error. Response headers are in either
  3077. // *Job.ServerResponse.Header or (if a response was returned at all) in
  3078. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3079. // whether the returned error was because http.StatusNotModified was
  3080. // returned.
  3081. func (c *ProjectsJobsSubmitCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  3082. gensupport.SetOptions(c.urlParams_, opts...)
  3083. res, err := c.doRequest("json")
  3084. if res != nil && res.StatusCode == http.StatusNotModified {
  3085. if res.Body != nil {
  3086. res.Body.Close()
  3087. }
  3088. return nil, &googleapi.Error{
  3089. Code: res.StatusCode,
  3090. Header: res.Header,
  3091. }
  3092. }
  3093. if err != nil {
  3094. return nil, err
  3095. }
  3096. defer googleapi.CloseBody(res)
  3097. if err := googleapi.CheckResponse(res); err != nil {
  3098. return nil, err
  3099. }
  3100. ret := &Job{
  3101. ServerResponse: googleapi.ServerResponse{
  3102. Header: res.Header,
  3103. HTTPStatusCode: res.StatusCode,
  3104. },
  3105. }
  3106. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3107. return nil, err
  3108. }
  3109. return ret, nil
  3110. // {
  3111. // "description": "Submits a job to a cluster.",
  3112. // "httpMethod": "POST",
  3113. // "id": "dataproc.projects.jobs.submit",
  3114. // "parameterOrder": [
  3115. // "projectId"
  3116. // ],
  3117. // "parameters": {
  3118. // "projectId": {
  3119. // "description": "[Required] The ID of the Google Cloud Platform project that the job belongs to.",
  3120. // "location": "path",
  3121. // "required": true,
  3122. // "type": "string"
  3123. // }
  3124. // },
  3125. // "path": "v1beta1/projects/{projectId}/jobs:submit",
  3126. // "request": {
  3127. // "$ref": "SubmitJobRequest"
  3128. // },
  3129. // "response": {
  3130. // "$ref": "Job"
  3131. // },
  3132. // "scopes": [
  3133. // "https://www.googleapis.com/auth/cloud-platform"
  3134. // ]
  3135. // }
  3136. }