source: vendor/google/apiclient-services/src/Dataflow/Resource/ProjectsJobs.php@ f9c482b

Last change on this file since f9c482b was f9c482b, checked in by Vlado 222039 <vlado.popovski@…>, 2 weeks ago

Upload new project files

  • Property mode set to 100644
File size: 10.0 KB
Line 
1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\Dataflow\Resource;
19
20use Google\Service\Dataflow\Job;
21use Google\Service\Dataflow\JobMetrics;
22use Google\Service\Dataflow\ListJobsResponse;
23use Google\Service\Dataflow\Snapshot;
24use Google\Service\Dataflow\SnapshotJobRequest;
25
26/**
27 * The "jobs" collection of methods.
28 * Typical usage is:
29 * <code>
30 * $dataflowService = new Google\Service\Dataflow(...);
31 * $jobs = $dataflowService->projects_jobs;
32 * </code>
33 */
34class ProjectsJobs extends \Google\Service\Resource
35{
36 /**
37 * List the jobs of a project across all regions. **Note:** This method doesn't
38 * support filtering the list of jobs by name. (jobs.aggregated)
39 *
40 * @param string $projectId The project which owns the jobs.
41 * @param array $optParams Optional parameters.
42 *
43 * @opt_param string filter The kind of filter to use.
44 * @opt_param string location The [regional endpoint]
45 * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
46 * contains this job.
47 * @opt_param string name Optional. The job name.
48 * @opt_param int pageSize If there are many jobs, limit response to at most
49 * this many. The actual number of jobs returned will be the lesser of
50 * max_responses and an unspecified server-defined limit.
51 * @opt_param string pageToken Set this to the 'next_page_token' field of a
52 * previous response to request additional results in a long list.
53 * @opt_param string view Deprecated. ListJobs always returns summaries now. Use
54 * GetJob for other JobViews.
55 * @return ListJobsResponse
56 * @throws \Google\Service\Exception
57 */
58 public function aggregated($projectId, $optParams = [])
59 {
60 $params = ['projectId' => $projectId];
61 $params = array_merge($params, $optParams);
62 return $this->call('aggregated', [$params], ListJobsResponse::class);
63 }
64 /**
65 * Creates a Cloud Dataflow job. To create a job, we recommend using
66 * `projects.locations.jobs.create` with a [regional endpoint]
67 * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
68 * `projects.jobs.create` is not recommended, as your job will always start in
69 * `us-central1`. Do not enter confidential information when you supply string
70 * values using the API. (jobs.create)
71 *
72 * @param string $projectId The ID of the Cloud Platform project that the job
73 * belongs to.
74 * @param Job $postBody
75 * @param array $optParams Optional parameters.
76 *
77 * @opt_param string location The [regional endpoint]
78 * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
79 * contains this job.
80 * @opt_param string replaceJobId Deprecated. This field is now in the Job
81 * message.
82 * @opt_param string view The level of information requested in response.
83 * @return Job
84 * @throws \Google\Service\Exception
85 */
86 public function create($projectId, Job $postBody, $optParams = [])
87 {
88 $params = ['projectId' => $projectId, 'postBody' => $postBody];
89 $params = array_merge($params, $optParams);
90 return $this->call('create', [$params], Job::class);
91 }
92 /**
93 * Gets the state of the specified Cloud Dataflow job. To get the state of a
94 * job, we recommend using `projects.locations.jobs.get` with a [regional
95 * endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-
96 * endpoints). Using `projects.jobs.get` is not recommended, as you can only get
97 * the state of jobs that are running in `us-central1`. (jobs.get)
98 *
99 * @param string $projectId The ID of the Cloud Platform project that the job
100 * belongs to.
101 * @param string $jobId The job ID.
102 * @param array $optParams Optional parameters.
103 *
104 * @opt_param string location The [regional endpoint]
105 * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
106 * contains this job.
107 * @opt_param string view The level of information requested in response.
108 * @return Job
109 * @throws \Google\Service\Exception
110 */
111 public function get($projectId, $jobId, $optParams = [])
112 {
113 $params = ['projectId' => $projectId, 'jobId' => $jobId];
114 $params = array_merge($params, $optParams);
115 return $this->call('get', [$params], Job::class);
116 }
117 /**
118 * Request the job status. To request the status of a job, we recommend using
119 * `projects.locations.jobs.getMetrics` with a [regional endpoint]
120 * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
121 * `projects.jobs.getMetrics` is not recommended, as you can only request the
122 * status of jobs that are running in `us-central1`. (jobs.getMetrics)
123 *
124 * @param string $projectId A project id.
125 * @param string $jobId The job to get metrics for.
126 * @param array $optParams Optional parameters.
127 *
128 * @opt_param string location The [regional endpoint]
129 * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
130 * contains the job specified by job_id.
131 * @opt_param string startTime Return only metric data that has changed since
132 * this time. Default is to return all information about all metrics for the
133 * job.
134 * @return JobMetrics
135 * @throws \Google\Service\Exception
136 */
137 public function getMetrics($projectId, $jobId, $optParams = [])
138 {
139 $params = ['projectId' => $projectId, 'jobId' => $jobId];
140 $params = array_merge($params, $optParams);
141 return $this->call('getMetrics', [$params], JobMetrics::class);
142 }
143 /**
144 * List the jobs of a project. To list the jobs of a project in a region, we
145 * recommend using `projects.locations.jobs.list` with a [regional endpoint]
146 * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). To list
147 * the all jobs across all regions, use `projects.jobs.aggregated`. Using
148 * `projects.jobs.list` is not recommended, because you can only get the list of
149 * jobs that are running in `us-central1`. `projects.locations.jobs.list` and
150 * `projects.jobs.list` support filtering the list of jobs by name. Filtering by
151 * name isn't supported by `projects.jobs.aggregated`. (jobs.listProjectsJobs)
152 *
153 * @param string $projectId The project which owns the jobs.
154 * @param array $optParams Optional parameters.
155 *
156 * @opt_param string filter The kind of filter to use.
157 * @opt_param string location The [regional endpoint]
158 * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
159 * contains this job.
160 * @opt_param string name Optional. The job name.
161 * @opt_param int pageSize If there are many jobs, limit response to at most
162 * this many. The actual number of jobs returned will be the lesser of
163 * max_responses and an unspecified server-defined limit.
164 * @opt_param string pageToken Set this to the 'next_page_token' field of a
165 * previous response to request additional results in a long list.
166 * @opt_param string view Deprecated. ListJobs always returns summaries now. Use
167 * GetJob for other JobViews.
168 * @return ListJobsResponse
169 * @throws \Google\Service\Exception
170 */
171 public function listProjectsJobs($projectId, $optParams = [])
172 {
173 $params = ['projectId' => $projectId];
174 $params = array_merge($params, $optParams);
175 return $this->call('list', [$params], ListJobsResponse::class);
176 }
177 /**
178 * Snapshot the state of a streaming job. (jobs.snapshot)
179 *
180 * @param string $projectId The project which owns the job to be snapshotted.
181 * @param string $jobId The job to be snapshotted.
182 * @param SnapshotJobRequest $postBody
183 * @param array $optParams Optional parameters.
184 * @return Snapshot
185 * @throws \Google\Service\Exception
186 */
187 public function snapshot($projectId, $jobId, SnapshotJobRequest $postBody, $optParams = [])
188 {
189 $params = ['projectId' => $projectId, 'jobId' => $jobId, 'postBody' => $postBody];
190 $params = array_merge($params, $optParams);
191 return $this->call('snapshot', [$params], Snapshot::class);
192 }
193 /**
194 * Updates the state of an existing Cloud Dataflow job. To update the state of
195 * an existing job, we recommend using `projects.locations.jobs.update` with a
196 * [regional endpoint]
197 * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
198 * `projects.jobs.update` is not recommended, as you can only update the state
199 * of jobs that are running in `us-central1`. (jobs.update)
200 *
201 * @param string $projectId The ID of the Cloud Platform project that the job
202 * belongs to.
203 * @param string $jobId The job ID.
204 * @param Job $postBody
205 * @param array $optParams Optional parameters.
206 *
207 * @opt_param string location The [regional endpoint]
208 * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
209 * contains this job.
210 * @opt_param string updateMask The list of fields to update relative to Job. If
211 * empty, only RequestedJobState will be considered for update. If the FieldMask
212 * is not empty and RequestedJobState is none/empty, The fields specified in the
213 * update mask will be the only ones considered for update. If both
214 * RequestedJobState and update_mask are specified, an error will be returned as
215 * we cannot update both state and mask.
216 * @return Job
217 * @throws \Google\Service\Exception
218 */
219 public function update($projectId, $jobId, Job $postBody, $optParams = [])
220 {
221 $params = ['projectId' => $projectId, 'jobId' => $jobId, 'postBody' => $postBody];
222 $params = array_merge($params, $optParams);
223 return $this->call('update', [$params], Job::class);
224 }
225}
226
227// Adding a class alias for backwards compatibility with the previous class name.
228class_alias(ProjectsJobs::class, 'Google_Service_Dataflow_Resource_ProjectsJobs');
Note: See TracBrowser for help on using the repository browser.