You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

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