Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

4686 Zeilen
179 KiB

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