25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

4574 lines
170 KiB

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