[e3d4e0a] | 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\GoogleCloudAiplatformV1CancelCustomJobRequest;
|
---|
| 21 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1CustomJob;
|
---|
| 22 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1ListCustomJobsResponse;
|
---|
| 23 | use Google\Service\Aiplatform\GoogleLongrunningOperation;
|
---|
| 24 | use Google\Service\Aiplatform\GoogleProtobufEmpty;
|
---|
| 25 |
|
---|
| 26 | /**
|
---|
| 27 | * The "customJobs" collection of methods.
|
---|
| 28 | * Typical usage is:
|
---|
| 29 | * <code>
|
---|
| 30 | * $aiplatformService = new Google\Service\Aiplatform(...);
|
---|
| 31 | * $customJobs = $aiplatformService->projects_locations_customJobs;
|
---|
| 32 | * </code>
|
---|
| 33 | */
|
---|
| 34 | class ProjectsLocationsCustomJobs extends \Google\Service\Resource
|
---|
| 35 | {
|
---|
| 36 | /**
|
---|
| 37 | * Cancels a CustomJob. Starts asynchronous cancellation on the CustomJob. The
|
---|
| 38 | * server makes a best effort to cancel the job, but success is not guaranteed.
|
---|
| 39 | * Clients can use JobService.GetCustomJob or other methods to check whether the
|
---|
| 40 | * cancellation succeeded or whether the job completed despite cancellation. On
|
---|
| 41 | * successful cancellation, the CustomJob is not deleted; instead it becomes a
|
---|
| 42 | * job with a CustomJob.error value with a google.rpc.Status.code of 1,
|
---|
| 43 | * corresponding to `Code.CANCELLED`, and CustomJob.state is set to `CANCELLED`.
|
---|
| 44 | * (customJobs.cancel)
|
---|
| 45 | *
|
---|
| 46 | * @param string $name Required. The name of the CustomJob to cancel. Format:
|
---|
| 47 | * `projects/{project}/locations/{location}/customJobs/{custom_job}`
|
---|
| 48 | * @param GoogleCloudAiplatformV1CancelCustomJobRequest $postBody
|
---|
| 49 | * @param array $optParams Optional parameters.
|
---|
| 50 | * @return GoogleProtobufEmpty
|
---|
| 51 | * @throws \Google\Service\Exception
|
---|
| 52 | */
|
---|
| 53 | public function cancel($name, GoogleCloudAiplatformV1CancelCustomJobRequest $postBody, $optParams = [])
|
---|
| 54 | {
|
---|
| 55 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 56 | $params = array_merge($params, $optParams);
|
---|
| 57 | return $this->call('cancel', [$params], GoogleProtobufEmpty::class);
|
---|
| 58 | }
|
---|
| 59 | /**
|
---|
| 60 | * Creates a CustomJob. A created CustomJob right away will be attempted to be
|
---|
| 61 | * run. (customJobs.create)
|
---|
| 62 | *
|
---|
| 63 | * @param string $parent Required. The resource name of the Location to create
|
---|
| 64 | * the CustomJob in. Format: `projects/{project}/locations/{location}`
|
---|
| 65 | * @param GoogleCloudAiplatformV1CustomJob $postBody
|
---|
| 66 | * @param array $optParams Optional parameters.
|
---|
| 67 | * @return GoogleCloudAiplatformV1CustomJob
|
---|
| 68 | * @throws \Google\Service\Exception
|
---|
| 69 | */
|
---|
| 70 | public function create($parent, GoogleCloudAiplatformV1CustomJob $postBody, $optParams = [])
|
---|
| 71 | {
|
---|
| 72 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 73 | $params = array_merge($params, $optParams);
|
---|
| 74 | return $this->call('create', [$params], GoogleCloudAiplatformV1CustomJob::class);
|
---|
| 75 | }
|
---|
| 76 | /**
|
---|
| 77 | * Deletes a CustomJob. (customJobs.delete)
|
---|
| 78 | *
|
---|
| 79 | * @param string $name Required. The name of the CustomJob resource to be
|
---|
| 80 | * deleted. Format:
|
---|
| 81 | * `projects/{project}/locations/{location}/customJobs/{custom_job}`
|
---|
| 82 | * @param array $optParams Optional parameters.
|
---|
| 83 | * @return GoogleLongrunningOperation
|
---|
| 84 | * @throws \Google\Service\Exception
|
---|
| 85 | */
|
---|
| 86 | public function delete($name, $optParams = [])
|
---|
| 87 | {
|
---|
| 88 | $params = ['name' => $name];
|
---|
| 89 | $params = array_merge($params, $optParams);
|
---|
| 90 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
| 91 | }
|
---|
| 92 | /**
|
---|
| 93 | * Gets a CustomJob. (customJobs.get)
|
---|
| 94 | *
|
---|
| 95 | * @param string $name Required. The name of the CustomJob resource. Format:
|
---|
| 96 | * `projects/{project}/locations/{location}/customJobs/{custom_job}`
|
---|
| 97 | * @param array $optParams Optional parameters.
|
---|
| 98 | * @return GoogleCloudAiplatformV1CustomJob
|
---|
| 99 | * @throws \Google\Service\Exception
|
---|
| 100 | */
|
---|
| 101 | public function get($name, $optParams = [])
|
---|
| 102 | {
|
---|
| 103 | $params = ['name' => $name];
|
---|
| 104 | $params = array_merge($params, $optParams);
|
---|
| 105 | return $this->call('get', [$params], GoogleCloudAiplatformV1CustomJob::class);
|
---|
| 106 | }
|
---|
| 107 | /**
|
---|
| 108 | * Lists CustomJobs in a Location. (customJobs.listProjectsLocationsCustomJobs)
|
---|
| 109 | *
|
---|
| 110 | * @param string $parent Required. The resource name of the Location to list the
|
---|
| 111 | * CustomJobs from. Format: `projects/{project}/locations/{location}`
|
---|
| 112 | * @param array $optParams Optional parameters.
|
---|
| 113 | *
|
---|
| 114 | * @opt_param string filter The standard list filter. Supported fields: *
|
---|
| 115 | * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. * `state`
|
---|
| 116 | * supports `=`, `!=` comparisons. * `create_time` supports `=`, `!=`,`<`,
|
---|
| 117 | * `<=`,`>`, `>=` comparisons. `create_time` must be in RFC 3339 format. *
|
---|
| 118 | * `labels` supports general map functions that is: `labels.key=value` -
|
---|
| 119 | * key:value equality `labels.key:* - key existence Some examples of using the
|
---|
| 120 | * filter are: * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` *
|
---|
| 121 | * `state!="JOB_STATE_FAILED" OR display_name="my_job"` * `NOT
|
---|
| 122 | * display_name="my_job"` * `create_time>"2021-05-18T00:00:00Z"` *
|
---|
| 123 | * `labels.keyA=valueA` * `labels.keyB:*`
|
---|
| 124 | * @opt_param int pageSize The standard list page size.
|
---|
| 125 | * @opt_param string pageToken The standard list page token. Typically obtained
|
---|
| 126 | * via ListCustomJobsResponse.next_page_token of the previous
|
---|
| 127 | * JobService.ListCustomJobs call.
|
---|
| 128 | * @opt_param string readMask Mask specifying which fields to read.
|
---|
| 129 | * @return GoogleCloudAiplatformV1ListCustomJobsResponse
|
---|
| 130 | * @throws \Google\Service\Exception
|
---|
| 131 | */
|
---|
| 132 | public function listProjectsLocationsCustomJobs($parent, $optParams = [])
|
---|
| 133 | {
|
---|
| 134 | $params = ['parent' => $parent];
|
---|
| 135 | $params = array_merge($params, $optParams);
|
---|
| 136 | return $this->call('list', [$params], GoogleCloudAiplatformV1ListCustomJobsResponse::class);
|
---|
| 137 | }
|
---|
| 138 | }
|
---|
| 139 |
|
---|
| 140 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 141 | class_alias(ProjectsLocationsCustomJobs::class, 'Google_Service_Aiplatform_Resource_ProjectsLocationsCustomJobs');
|
---|