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\CloudMachineLearningEngine\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudMachineLearningEngine\GoogleCloudMlV1CancelJobRequest;
|
---|
21 | use Google\Service\CloudMachineLearningEngine\GoogleCloudMlV1Job;
|
---|
22 | use Google\Service\CloudMachineLearningEngine\GoogleCloudMlV1ListJobsResponse;
|
---|
23 | use Google\Service\CloudMachineLearningEngine\GoogleIamV1Policy;
|
---|
24 | use Google\Service\CloudMachineLearningEngine\GoogleIamV1SetIamPolicyRequest;
|
---|
25 | use Google\Service\CloudMachineLearningEngine\GoogleIamV1TestIamPermissionsRequest;
|
---|
26 | use Google\Service\CloudMachineLearningEngine\GoogleIamV1TestIamPermissionsResponse;
|
---|
27 | use Google\Service\CloudMachineLearningEngine\GoogleProtobufEmpty;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * The "jobs" collection of methods.
|
---|
31 | * Typical usage is:
|
---|
32 | * <code>
|
---|
33 | * $mlService = new Google\Service\CloudMachineLearningEngine(...);
|
---|
34 | * $jobs = $mlService->projects_jobs;
|
---|
35 | * </code>
|
---|
36 | */
|
---|
37 | class ProjectsJobs extends \Google\Service\Resource
|
---|
38 | {
|
---|
39 | /**
|
---|
40 | * Cancels a running job. (jobs.cancel)
|
---|
41 | *
|
---|
42 | * @param string $name Required. The name of the job to cancel.
|
---|
43 | * @param GoogleCloudMlV1CancelJobRequest $postBody
|
---|
44 | * @param array $optParams Optional parameters.
|
---|
45 | * @return GoogleProtobufEmpty
|
---|
46 | * @throws \Google\Service\Exception
|
---|
47 | */
|
---|
48 | public function cancel($name, GoogleCloudMlV1CancelJobRequest $postBody, $optParams = [])
|
---|
49 | {
|
---|
50 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
51 | $params = array_merge($params, $optParams);
|
---|
52 | return $this->call('cancel', [$params], GoogleProtobufEmpty::class);
|
---|
53 | }
|
---|
54 | /**
|
---|
55 | * Creates a training or a batch prediction job. (jobs.create)
|
---|
56 | *
|
---|
57 | * @param string $parent Required. The project name.
|
---|
58 | * @param GoogleCloudMlV1Job $postBody
|
---|
59 | * @param array $optParams Optional parameters.
|
---|
60 | * @return GoogleCloudMlV1Job
|
---|
61 | * @throws \Google\Service\Exception
|
---|
62 | */
|
---|
63 | public function create($parent, GoogleCloudMlV1Job $postBody, $optParams = [])
|
---|
64 | {
|
---|
65 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
66 | $params = array_merge($params, $optParams);
|
---|
67 | return $this->call('create', [$params], GoogleCloudMlV1Job::class);
|
---|
68 | }
|
---|
69 | /**
|
---|
70 | * Describes a job. (jobs.get)
|
---|
71 | *
|
---|
72 | * @param string $name Required. The name of the job to get the description of.
|
---|
73 | * @param array $optParams Optional parameters.
|
---|
74 | * @return GoogleCloudMlV1Job
|
---|
75 | * @throws \Google\Service\Exception
|
---|
76 | */
|
---|
77 | public function get($name, $optParams = [])
|
---|
78 | {
|
---|
79 | $params = ['name' => $name];
|
---|
80 | $params = array_merge($params, $optParams);
|
---|
81 | return $this->call('get', [$params], GoogleCloudMlV1Job::class);
|
---|
82 | }
|
---|
83 | /**
|
---|
84 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
85 | * resource exists and does not have a policy set. (jobs.getIamPolicy)
|
---|
86 | *
|
---|
87 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
88 | * requested. See [Resource
|
---|
89 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
90 | * appropriate value for this field.
|
---|
91 | * @param array $optParams Optional parameters.
|
---|
92 | *
|
---|
93 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
94 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
95 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
96 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
97 | * conditional role bindings may specify any valid value or leave the field
|
---|
98 | * unset. The policy in the response might use the policy version that you
|
---|
99 | * specified, or it might use a lower policy version. For example, if you
|
---|
100 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
101 | * response uses version 1. To learn which resources support conditions in their
|
---|
102 | * IAM policies, see the [IAM
|
---|
103 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
104 | * policies).
|
---|
105 | * @return GoogleIamV1Policy
|
---|
106 | * @throws \Google\Service\Exception
|
---|
107 | */
|
---|
108 | public function getIamPolicy($resource, $optParams = [])
|
---|
109 | {
|
---|
110 | $params = ['resource' => $resource];
|
---|
111 | $params = array_merge($params, $optParams);
|
---|
112 | return $this->call('getIamPolicy', [$params], GoogleIamV1Policy::class);
|
---|
113 | }
|
---|
114 | /**
|
---|
115 | * Lists the jobs in the project. If there are no jobs that match the request
|
---|
116 | * parameters, the list request returns an empty response body: {}.
|
---|
117 | * (jobs.listProjectsJobs)
|
---|
118 | *
|
---|
119 | * @param string $parent Required. The name of the project for which to list
|
---|
120 | * jobs.
|
---|
121 | * @param array $optParams Optional parameters.
|
---|
122 | *
|
---|
123 | * @opt_param string filter Optional. Specifies the subset of jobs to retrieve.
|
---|
124 | * You can filter on the value of one or more attributes of the job object. For
|
---|
125 | * example, retrieve jobs with a job identifier that starts with 'census':
|
---|
126 | * gcloud ai-platform jobs list --filter='jobId:census*' List all failed jobs
|
---|
127 | * with names that start with 'rnn': gcloud ai-platform jobs list
|
---|
128 | * --filter='jobId:rnn* AND state:FAILED' For more examples, see the guide to
|
---|
129 | * monitoring jobs.
|
---|
130 | * @opt_param int pageSize Optional. The number of jobs to retrieve per "page"
|
---|
131 | * of results. If there are more remaining results than this number, the
|
---|
132 | * response message will contain a valid value in the `next_page_token` field.
|
---|
133 | * The default value is 20, and the maximum page size is 100.
|
---|
134 | * @opt_param string pageToken Optional. A page token to request the next page
|
---|
135 | * of results. You get the token from the `next_page_token` field of the
|
---|
136 | * response from the previous call.
|
---|
137 | * @return GoogleCloudMlV1ListJobsResponse
|
---|
138 | * @throws \Google\Service\Exception
|
---|
139 | */
|
---|
140 | public function listProjectsJobs($parent, $optParams = [])
|
---|
141 | {
|
---|
142 | $params = ['parent' => $parent];
|
---|
143 | $params = array_merge($params, $optParams);
|
---|
144 | return $this->call('list', [$params], GoogleCloudMlV1ListJobsResponse::class);
|
---|
145 | }
|
---|
146 | /**
|
---|
147 | * Updates a specific job resource. Currently the only supported fields to
|
---|
148 | * update are `labels`. (jobs.patch)
|
---|
149 | *
|
---|
150 | * @param string $name Required. The job name.
|
---|
151 | * @param GoogleCloudMlV1Job $postBody
|
---|
152 | * @param array $optParams Optional parameters.
|
---|
153 | *
|
---|
154 | * @opt_param string updateMask Required. Specifies the path, relative to `Job`,
|
---|
155 | * of the field to update. To adopt etag mechanism, include `etag` field in the
|
---|
156 | * mask, and include the `etag` value in your job resource. For example, to
|
---|
157 | * change the labels of a job, the `update_mask` parameter would be specified as
|
---|
158 | * `labels`, `etag`, and the `PATCH` request body would specify the new value,
|
---|
159 | * as follows: { "labels": { "owner": "Google", "color": "Blue" } "etag":
|
---|
160 | * "33a64df551425fcc55e4d42a148795d9f25f89d4" } If `etag` matches the one on the
|
---|
161 | * server, the labels of the job will be replaced with the given ones, and the
|
---|
162 | * server end `etag` will be recalculated. Currently the only supported update
|
---|
163 | * masks are `labels` and `etag`.
|
---|
164 | * @return GoogleCloudMlV1Job
|
---|
165 | * @throws \Google\Service\Exception
|
---|
166 | */
|
---|
167 | public function patch($name, GoogleCloudMlV1Job $postBody, $optParams = [])
|
---|
168 | {
|
---|
169 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
170 | $params = array_merge($params, $optParams);
|
---|
171 | return $this->call('patch', [$params], GoogleCloudMlV1Job::class);
|
---|
172 | }
|
---|
173 | /**
|
---|
174 | * Sets the access control policy on the specified resource. Replaces any
|
---|
175 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
176 | * `PERMISSION_DENIED` errors. (jobs.setIamPolicy)
|
---|
177 | *
|
---|
178 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
179 | * specified. See [Resource
|
---|
180 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
181 | * appropriate value for this field.
|
---|
182 | * @param GoogleIamV1SetIamPolicyRequest $postBody
|
---|
183 | * @param array $optParams Optional parameters.
|
---|
184 | * @return GoogleIamV1Policy
|
---|
185 | * @throws \Google\Service\Exception
|
---|
186 | */
|
---|
187 | public function setIamPolicy($resource, GoogleIamV1SetIamPolicyRequest $postBody, $optParams = [])
|
---|
188 | {
|
---|
189 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
190 | $params = array_merge($params, $optParams);
|
---|
191 | return $this->call('setIamPolicy', [$params], GoogleIamV1Policy::class);
|
---|
192 | }
|
---|
193 | /**
|
---|
194 | * Returns permissions that a caller has on the specified resource. If the
|
---|
195 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
196 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
197 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
198 | * This operation may "fail open" without warning. (jobs.testIamPermissions)
|
---|
199 | *
|
---|
200 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
201 | * being requested. See [Resource
|
---|
202 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
203 | * appropriate value for this field.
|
---|
204 | * @param GoogleIamV1TestIamPermissionsRequest $postBody
|
---|
205 | * @param array $optParams Optional parameters.
|
---|
206 | * @return GoogleIamV1TestIamPermissionsResponse
|
---|
207 | * @throws \Google\Service\Exception
|
---|
208 | */
|
---|
209 | public function testIamPermissions($resource, GoogleIamV1TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
210 | {
|
---|
211 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
212 | $params = array_merge($params, $optParams);
|
---|
213 | return $this->call('testIamPermissions', [$params], GoogleIamV1TestIamPermissionsResponse::class);
|
---|
214 | }
|
---|
215 | }
|
---|
216 |
|
---|
217 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
218 | class_alias(ProjectsJobs::class, 'Google_Service_CloudMachineLearningEngine_Resource_ProjectsJobs');
|
---|