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 |
|
---|
18 | namespace Google\Service\Aiplatform\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1BatchCancelPipelineJobsRequest;
|
---|
21 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1BatchDeletePipelineJobsRequest;
|
---|
22 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1CancelPipelineJobRequest;
|
---|
23 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1ListPipelineJobsResponse;
|
---|
24 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1PipelineJob;
|
---|
25 | use Google\Service\Aiplatform\GoogleLongrunningOperation;
|
---|
26 | use Google\Service\Aiplatform\GoogleProtobufEmpty;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "pipelineJobs" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $aiplatformService = new Google\Service\Aiplatform(...);
|
---|
33 | * $pipelineJobs = $aiplatformService->projects_locations_pipelineJobs;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class ProjectsLocationsPipelineJobs extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Batch cancel PipelineJobs. Firstly the server will check if all the jobs are
|
---|
40 | * in non-terminal states, and skip the jobs that are already terminated. If the
|
---|
41 | * operation failed, none of the pipeline jobs are cancelled. The server will
|
---|
42 | * poll the states of all the pipeline jobs periodically to check the
|
---|
43 | * cancellation status. This operation will return an LRO.
|
---|
44 | * (pipelineJobs.batchCancel)
|
---|
45 | *
|
---|
46 | * @param string $parent Required. The name of the PipelineJobs' parent
|
---|
47 | * resource. Format: `projects/{project}/locations/{location}`
|
---|
48 | * @param GoogleCloudAiplatformV1BatchCancelPipelineJobsRequest $postBody
|
---|
49 | * @param array $optParams Optional parameters.
|
---|
50 | * @return GoogleLongrunningOperation
|
---|
51 | * @throws \Google\Service\Exception
|
---|
52 | */
|
---|
53 | public function batchCancel($parent, GoogleCloudAiplatformV1BatchCancelPipelineJobsRequest $postBody, $optParams = [])
|
---|
54 | {
|
---|
55 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
56 | $params = array_merge($params, $optParams);
|
---|
57 | return $this->call('batchCancel', [$params], GoogleLongrunningOperation::class);
|
---|
58 | }
|
---|
59 | /**
|
---|
60 | * Batch deletes PipelineJobs The Operation is atomic. If it fails, none of the
|
---|
61 | * PipelineJobs are deleted. If it succeeds, all of the PipelineJobs are
|
---|
62 | * deleted. (pipelineJobs.batchDelete)
|
---|
63 | *
|
---|
64 | * @param string $parent Required. The name of the PipelineJobs' parent
|
---|
65 | * resource. Format: `projects/{project}/locations/{location}`
|
---|
66 | * @param GoogleCloudAiplatformV1BatchDeletePipelineJobsRequest $postBody
|
---|
67 | * @param array $optParams Optional parameters.
|
---|
68 | * @return GoogleLongrunningOperation
|
---|
69 | * @throws \Google\Service\Exception
|
---|
70 | */
|
---|
71 | public function batchDelete($parent, GoogleCloudAiplatformV1BatchDeletePipelineJobsRequest $postBody, $optParams = [])
|
---|
72 | {
|
---|
73 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
74 | $params = array_merge($params, $optParams);
|
---|
75 | return $this->call('batchDelete', [$params], GoogleLongrunningOperation::class);
|
---|
76 | }
|
---|
77 | /**
|
---|
78 | * Cancels a PipelineJob. Starts asynchronous cancellation on the PipelineJob.
|
---|
79 | * The server makes a best effort to cancel the pipeline, but success is not
|
---|
80 | * guaranteed. Clients can use PipelineService.GetPipelineJob or other methods
|
---|
81 | * to check whether the cancellation succeeded or whether the pipeline completed
|
---|
82 | * despite cancellation. On successful cancellation, the PipelineJob is not
|
---|
83 | * deleted; instead it becomes a pipeline with a PipelineJob.error value with a
|
---|
84 | * google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`, and
|
---|
85 | * PipelineJob.state is set to `CANCELLED`. (pipelineJobs.cancel)
|
---|
86 | *
|
---|
87 | * @param string $name Required. The name of the PipelineJob to cancel. Format:
|
---|
88 | * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`
|
---|
89 | * @param GoogleCloudAiplatformV1CancelPipelineJobRequest $postBody
|
---|
90 | * @param array $optParams Optional parameters.
|
---|
91 | * @return GoogleProtobufEmpty
|
---|
92 | * @throws \Google\Service\Exception
|
---|
93 | */
|
---|
94 | public function cancel($name, GoogleCloudAiplatformV1CancelPipelineJobRequest $postBody, $optParams = [])
|
---|
95 | {
|
---|
96 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
97 | $params = array_merge($params, $optParams);
|
---|
98 | return $this->call('cancel', [$params], GoogleProtobufEmpty::class);
|
---|
99 | }
|
---|
100 | /**
|
---|
101 | * Creates a PipelineJob. A PipelineJob will run immediately when created.
|
---|
102 | * (pipelineJobs.create)
|
---|
103 | *
|
---|
104 | * @param string $parent Required. The resource name of the Location to create
|
---|
105 | * the PipelineJob in. Format: `projects/{project}/locations/{location}`
|
---|
106 | * @param GoogleCloudAiplatformV1PipelineJob $postBody
|
---|
107 | * @param array $optParams Optional parameters.
|
---|
108 | *
|
---|
109 | * @opt_param string pipelineJobId The ID to use for the PipelineJob, which will
|
---|
110 | * become the final component of the PipelineJob name. If not provided, an ID
|
---|
111 | * will be automatically generated. This value should be less than 128
|
---|
112 | * characters, and valid characters are `/a-z-/`.
|
---|
113 | * @return GoogleCloudAiplatformV1PipelineJob
|
---|
114 | * @throws \Google\Service\Exception
|
---|
115 | */
|
---|
116 | public function create($parent, GoogleCloudAiplatformV1PipelineJob $postBody, $optParams = [])
|
---|
117 | {
|
---|
118 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
119 | $params = array_merge($params, $optParams);
|
---|
120 | return $this->call('create', [$params], GoogleCloudAiplatformV1PipelineJob::class);
|
---|
121 | }
|
---|
122 | /**
|
---|
123 | * Deletes a PipelineJob. (pipelineJobs.delete)
|
---|
124 | *
|
---|
125 | * @param string $name Required. The name of the PipelineJob resource to be
|
---|
126 | * deleted. Format:
|
---|
127 | * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`
|
---|
128 | * @param array $optParams Optional parameters.
|
---|
129 | * @return GoogleLongrunningOperation
|
---|
130 | * @throws \Google\Service\Exception
|
---|
131 | */
|
---|
132 | public function delete($name, $optParams = [])
|
---|
133 | {
|
---|
134 | $params = ['name' => $name];
|
---|
135 | $params = array_merge($params, $optParams);
|
---|
136 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
137 | }
|
---|
138 | /**
|
---|
139 | * Gets a PipelineJob. (pipelineJobs.get)
|
---|
140 | *
|
---|
141 | * @param string $name Required. The name of the PipelineJob resource. Format:
|
---|
142 | * `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`
|
---|
143 | * @param array $optParams Optional parameters.
|
---|
144 | * @return GoogleCloudAiplatformV1PipelineJob
|
---|
145 | * @throws \Google\Service\Exception
|
---|
146 | */
|
---|
147 | public function get($name, $optParams = [])
|
---|
148 | {
|
---|
149 | $params = ['name' => $name];
|
---|
150 | $params = array_merge($params, $optParams);
|
---|
151 | return $this->call('get', [$params], GoogleCloudAiplatformV1PipelineJob::class);
|
---|
152 | }
|
---|
153 | /**
|
---|
154 | * Lists PipelineJobs in a Location.
|
---|
155 | * (pipelineJobs.listProjectsLocationsPipelineJobs)
|
---|
156 | *
|
---|
157 | * @param string $parent Required. The resource name of the Location to list the
|
---|
158 | * PipelineJobs from. Format: `projects/{project}/locations/{location}`
|
---|
159 | * @param array $optParams Optional parameters.
|
---|
160 | *
|
---|
161 | * @opt_param string filter Lists the PipelineJobs that match the filter
|
---|
162 | * expression. The following fields are supported: * `pipeline_name`: Supports
|
---|
163 | * `=` and `!=` comparisons. * `display_name`: Supports `=`, `!=` comparisons,
|
---|
164 | * and `:` wildcard. * `pipeline_job_user_id`: Supports `=`, `!=` comparisons,
|
---|
165 | * and `:` wildcard. for example, can check if pipeline's display_name contains
|
---|
166 | * *step* by doing display_name:\"*step*\" * `state`: Supports `=` and `!=`
|
---|
167 | * comparisons. * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=`
|
---|
168 | * comparisons. Values must be in RFC 3339 format. * `update_time`: Supports
|
---|
169 | * `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. Values must be in RFC 3339
|
---|
170 | * format. * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=`
|
---|
171 | * comparisons. Values must be in RFC 3339 format. * `labels`: Supports key-
|
---|
172 | * value equality and key presence. * `template_uri`: Supports `=`, `!=`
|
---|
173 | * comparisons, and `:` wildcard. * `template_metadata.version`: Supports `=`,
|
---|
174 | * `!=` comparisons, and `:` wildcard. Filter expressions can be combined
|
---|
175 | * together using logical operators (`AND` & `OR`). For example:
|
---|
176 | * `pipeline_name="test" AND create_time>"2020-05-18T13:30:00Z"`. The syntax to
|
---|
177 | * define filter expression is based on https://google.aip.dev/160. Examples: *
|
---|
178 | * `create_time>"2021-05-18T00:00:00Z" OR update_time>"2020-05-18T00:00:00Z"`
|
---|
179 | * PipelineJobs created or updated after 2020-05-18 00:00:00 UTC. * `labels.env
|
---|
180 | * = "prod"` PipelineJobs with label "env" set to "prod".
|
---|
181 | * @opt_param string orderBy A comma-separated list of fields to order by. The
|
---|
182 | * default sort order is in ascending order. Use "desc" after a field name for
|
---|
183 | * descending. You can have multiple order_by fields provided e.g. "create_time
|
---|
184 | * desc, end_time", "end_time, start_time, update_time" For example, using
|
---|
185 | * "create_time desc, end_time" will order results by create time in descending
|
---|
186 | * order, and if there are multiple jobs having the same create time, order them
|
---|
187 | * by the end time in ascending order. if order_by is not specified, it will
|
---|
188 | * order by default order is create time in descending order. Supported fields:
|
---|
189 | * * `create_time` * `update_time` * `end_time` * `start_time`
|
---|
190 | * @opt_param int pageSize The standard list page size.
|
---|
191 | * @opt_param string pageToken The standard list page token. Typically obtained
|
---|
192 | * via ListPipelineJobsResponse.next_page_token of the previous
|
---|
193 | * PipelineService.ListPipelineJobs call.
|
---|
194 | * @opt_param string readMask Mask specifying which fields to read.
|
---|
195 | * @return GoogleCloudAiplatformV1ListPipelineJobsResponse
|
---|
196 | * @throws \Google\Service\Exception
|
---|
197 | */
|
---|
198 | public function listProjectsLocationsPipelineJobs($parent, $optParams = [])
|
---|
199 | {
|
---|
200 | $params = ['parent' => $parent];
|
---|
201 | $params = array_merge($params, $optParams);
|
---|
202 | return $this->call('list', [$params], GoogleCloudAiplatformV1ListPipelineJobsResponse::class);
|
---|
203 | }
|
---|
204 | }
|
---|
205 |
|
---|
206 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
207 | class_alias(ProjectsLocationsPipelineJobs::class, 'Google_Service_Aiplatform_Resource_ProjectsLocationsPipelineJobs');
|
---|