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\GoogleCloudAiplatformV1DeployIndexRequest;
|
---|
21 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1DeployedIndex;
|
---|
22 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1FindNeighborsRequest;
|
---|
23 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1FindNeighborsResponse;
|
---|
24 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1IndexEndpoint;
|
---|
25 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1ListIndexEndpointsResponse;
|
---|
26 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1ReadIndexDatapointsRequest;
|
---|
27 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1ReadIndexDatapointsResponse;
|
---|
28 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1UndeployIndexRequest;
|
---|
29 | use Google\Service\Aiplatform\GoogleLongrunningOperation;
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * The "indexEndpoints" collection of methods.
|
---|
33 | * Typical usage is:
|
---|
34 | * <code>
|
---|
35 | * $aiplatformService = new Google\Service\Aiplatform(...);
|
---|
36 | * $indexEndpoints = $aiplatformService->projects_locations_indexEndpoints;
|
---|
37 | * </code>
|
---|
38 | */
|
---|
39 | class ProjectsLocationsIndexEndpoints extends \Google\Service\Resource
|
---|
40 | {
|
---|
41 | /**
|
---|
42 | * Creates an IndexEndpoint. (indexEndpoints.create)
|
---|
43 | *
|
---|
44 | * @param string $parent Required. The resource name of the Location to create
|
---|
45 | * the IndexEndpoint in. Format: `projects/{project}/locations/{location}`
|
---|
46 | * @param GoogleCloudAiplatformV1IndexEndpoint $postBody
|
---|
47 | * @param array $optParams Optional parameters.
|
---|
48 | * @return GoogleLongrunningOperation
|
---|
49 | * @throws \Google\Service\Exception
|
---|
50 | */
|
---|
51 | public function create($parent, GoogleCloudAiplatformV1IndexEndpoint $postBody, $optParams = [])
|
---|
52 | {
|
---|
53 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
54 | $params = array_merge($params, $optParams);
|
---|
55 | return $this->call('create', [$params], GoogleLongrunningOperation::class);
|
---|
56 | }
|
---|
57 | /**
|
---|
58 | * Deletes an IndexEndpoint. (indexEndpoints.delete)
|
---|
59 | *
|
---|
60 | * @param string $name Required. The name of the IndexEndpoint resource to be
|
---|
61 | * deleted. Format:
|
---|
62 | * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
|
---|
63 | * @param array $optParams Optional parameters.
|
---|
64 | * @return GoogleLongrunningOperation
|
---|
65 | * @throws \Google\Service\Exception
|
---|
66 | */
|
---|
67 | public function delete($name, $optParams = [])
|
---|
68 | {
|
---|
69 | $params = ['name' => $name];
|
---|
70 | $params = array_merge($params, $optParams);
|
---|
71 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
72 | }
|
---|
73 | /**
|
---|
74 | * Deploys an Index into this IndexEndpoint, creating a DeployedIndex within it.
|
---|
75 | * Only non-empty Indexes can be deployed. (indexEndpoints.deployIndex)
|
---|
76 | *
|
---|
77 | * @param string $indexEndpoint Required. The name of the IndexEndpoint resource
|
---|
78 | * into which to deploy an Index. Format:
|
---|
79 | * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
|
---|
80 | * @param GoogleCloudAiplatformV1DeployIndexRequest $postBody
|
---|
81 | * @param array $optParams Optional parameters.
|
---|
82 | * @return GoogleLongrunningOperation
|
---|
83 | * @throws \Google\Service\Exception
|
---|
84 | */
|
---|
85 | public function deployIndex($indexEndpoint, GoogleCloudAiplatformV1DeployIndexRequest $postBody, $optParams = [])
|
---|
86 | {
|
---|
87 | $params = ['indexEndpoint' => $indexEndpoint, 'postBody' => $postBody];
|
---|
88 | $params = array_merge($params, $optParams);
|
---|
89 | return $this->call('deployIndex', [$params], GoogleLongrunningOperation::class);
|
---|
90 | }
|
---|
91 | /**
|
---|
92 | * Finds the nearest neighbors of each vector within the request.
|
---|
93 | * (indexEndpoints.findNeighbors)
|
---|
94 | *
|
---|
95 | * @param string $indexEndpoint Required. The name of the index endpoint.
|
---|
96 | * Format:
|
---|
97 | * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
|
---|
98 | * @param GoogleCloudAiplatformV1FindNeighborsRequest $postBody
|
---|
99 | * @param array $optParams Optional parameters.
|
---|
100 | * @return GoogleCloudAiplatformV1FindNeighborsResponse
|
---|
101 | * @throws \Google\Service\Exception
|
---|
102 | */
|
---|
103 | public function findNeighbors($indexEndpoint, GoogleCloudAiplatformV1FindNeighborsRequest $postBody, $optParams = [])
|
---|
104 | {
|
---|
105 | $params = ['indexEndpoint' => $indexEndpoint, 'postBody' => $postBody];
|
---|
106 | $params = array_merge($params, $optParams);
|
---|
107 | return $this->call('findNeighbors', [$params], GoogleCloudAiplatformV1FindNeighborsResponse::class);
|
---|
108 | }
|
---|
109 | /**
|
---|
110 | * Gets an IndexEndpoint. (indexEndpoints.get)
|
---|
111 | *
|
---|
112 | * @param string $name Required. The name of the IndexEndpoint resource. Format:
|
---|
113 | * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
|
---|
114 | * @param array $optParams Optional parameters.
|
---|
115 | * @return GoogleCloudAiplatformV1IndexEndpoint
|
---|
116 | * @throws \Google\Service\Exception
|
---|
117 | */
|
---|
118 | public function get($name, $optParams = [])
|
---|
119 | {
|
---|
120 | $params = ['name' => $name];
|
---|
121 | $params = array_merge($params, $optParams);
|
---|
122 | return $this->call('get', [$params], GoogleCloudAiplatformV1IndexEndpoint::class);
|
---|
123 | }
|
---|
124 | /**
|
---|
125 | * Lists IndexEndpoints in a Location.
|
---|
126 | * (indexEndpoints.listProjectsLocationsIndexEndpoints)
|
---|
127 | *
|
---|
128 | * @param string $parent Required. The resource name of the Location from which
|
---|
129 | * to list the IndexEndpoints. Format: `projects/{project}/locations/{location}`
|
---|
130 | * @param array $optParams Optional parameters.
|
---|
131 | *
|
---|
132 | * @opt_param string filter Optional. An expression for filtering the results of
|
---|
133 | * the request. For field names both snake_case and camelCase are supported. *
|
---|
134 | * `index_endpoint` supports = and !=. `index_endpoint` represents the
|
---|
135 | * IndexEndpoint ID, ie. the last segment of the IndexEndpoint's resourcename. *
|
---|
136 | * `display_name` supports =, != and regex() (uses
|
---|
137 | * [re2](https://github.com/google/re2/wiki/Syntax) syntax) * `labels` supports
|
---|
138 | * general map functions that is: `labels.key=value` - key:value equality
|
---|
139 | * `labels.key:* or labels:key - key existence A key including a space must be
|
---|
140 | * quoted. `labels."a key"`. Some examples: * `index_endpoint="1"` *
|
---|
141 | * `display_name="myDisplayName"` * `regex(display_name, "^A") -> The display
|
---|
142 | * name starts with an A. * `labels.myKey="myValue"`
|
---|
143 | * @opt_param int pageSize Optional. The standard list page size.
|
---|
144 | * @opt_param string pageToken Optional. The standard list page token. Typically
|
---|
145 | * obtained via ListIndexEndpointsResponse.next_page_token of the previous
|
---|
146 | * IndexEndpointService.ListIndexEndpoints call.
|
---|
147 | * @opt_param string readMask Optional. Mask specifying which fields to read.
|
---|
148 | * @return GoogleCloudAiplatformV1ListIndexEndpointsResponse
|
---|
149 | * @throws \Google\Service\Exception
|
---|
150 | */
|
---|
151 | public function listProjectsLocationsIndexEndpoints($parent, $optParams = [])
|
---|
152 | {
|
---|
153 | $params = ['parent' => $parent];
|
---|
154 | $params = array_merge($params, $optParams);
|
---|
155 | return $this->call('list', [$params], GoogleCloudAiplatformV1ListIndexEndpointsResponse::class);
|
---|
156 | }
|
---|
157 | /**
|
---|
158 | * Update an existing DeployedIndex under an IndexEndpoint.
|
---|
159 | * (indexEndpoints.mutateDeployedIndex)
|
---|
160 | *
|
---|
161 | * @param string $indexEndpoint Required. The name of the IndexEndpoint resource
|
---|
162 | * into which to deploy an Index. Format:
|
---|
163 | * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
|
---|
164 | * @param GoogleCloudAiplatformV1DeployedIndex $postBody
|
---|
165 | * @param array $optParams Optional parameters.
|
---|
166 | * @return GoogleLongrunningOperation
|
---|
167 | * @throws \Google\Service\Exception
|
---|
168 | */
|
---|
169 | public function mutateDeployedIndex($indexEndpoint, GoogleCloudAiplatformV1DeployedIndex $postBody, $optParams = [])
|
---|
170 | {
|
---|
171 | $params = ['indexEndpoint' => $indexEndpoint, 'postBody' => $postBody];
|
---|
172 | $params = array_merge($params, $optParams);
|
---|
173 | return $this->call('mutateDeployedIndex', [$params], GoogleLongrunningOperation::class);
|
---|
174 | }
|
---|
175 | /**
|
---|
176 | * Updates an IndexEndpoint. (indexEndpoints.patch)
|
---|
177 | *
|
---|
178 | * @param string $name Output only. The resource name of the IndexEndpoint.
|
---|
179 | * @param GoogleCloudAiplatformV1IndexEndpoint $postBody
|
---|
180 | * @param array $optParams Optional parameters.
|
---|
181 | *
|
---|
182 | * @opt_param string updateMask Required. The update mask applies to the
|
---|
183 | * resource. See google.protobuf.FieldMask.
|
---|
184 | * @return GoogleCloudAiplatformV1IndexEndpoint
|
---|
185 | * @throws \Google\Service\Exception
|
---|
186 | */
|
---|
187 | public function patch($name, GoogleCloudAiplatformV1IndexEndpoint $postBody, $optParams = [])
|
---|
188 | {
|
---|
189 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
190 | $params = array_merge($params, $optParams);
|
---|
191 | return $this->call('patch', [$params], GoogleCloudAiplatformV1IndexEndpoint::class);
|
---|
192 | }
|
---|
193 | /**
|
---|
194 | * Reads the datapoints/vectors of the given IDs. A maximum of 1000 datapoints
|
---|
195 | * can be retrieved in a batch. (indexEndpoints.readIndexDatapoints)
|
---|
196 | *
|
---|
197 | * @param string $indexEndpoint Required. The name of the index endpoint.
|
---|
198 | * Format:
|
---|
199 | * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
|
---|
200 | * @param GoogleCloudAiplatformV1ReadIndexDatapointsRequest $postBody
|
---|
201 | * @param array $optParams Optional parameters.
|
---|
202 | * @return GoogleCloudAiplatformV1ReadIndexDatapointsResponse
|
---|
203 | * @throws \Google\Service\Exception
|
---|
204 | */
|
---|
205 | public function readIndexDatapoints($indexEndpoint, GoogleCloudAiplatformV1ReadIndexDatapointsRequest $postBody, $optParams = [])
|
---|
206 | {
|
---|
207 | $params = ['indexEndpoint' => $indexEndpoint, 'postBody' => $postBody];
|
---|
208 | $params = array_merge($params, $optParams);
|
---|
209 | return $this->call('readIndexDatapoints', [$params], GoogleCloudAiplatformV1ReadIndexDatapointsResponse::class);
|
---|
210 | }
|
---|
211 | /**
|
---|
212 | * Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it,
|
---|
213 | * and freeing all resources it's using. (indexEndpoints.undeployIndex)
|
---|
214 | *
|
---|
215 | * @param string $indexEndpoint Required. The name of the IndexEndpoint resource
|
---|
216 | * from which to undeploy an Index. Format:
|
---|
217 | * `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
|
---|
218 | * @param GoogleCloudAiplatformV1UndeployIndexRequest $postBody
|
---|
219 | * @param array $optParams Optional parameters.
|
---|
220 | * @return GoogleLongrunningOperation
|
---|
221 | * @throws \Google\Service\Exception
|
---|
222 | */
|
---|
223 | public function undeployIndex($indexEndpoint, GoogleCloudAiplatformV1UndeployIndexRequest $postBody, $optParams = [])
|
---|
224 | {
|
---|
225 | $params = ['indexEndpoint' => $indexEndpoint, 'postBody' => $postBody];
|
---|
226 | $params = array_merge($params, $optParams);
|
---|
227 | return $this->call('undeployIndex', [$params], GoogleLongrunningOperation::class);
|
---|
228 | }
|
---|
229 | }
|
---|
230 |
|
---|
231 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
232 | class_alias(ProjectsLocationsIndexEndpoints::class, 'Google_Service_Aiplatform_Resource_ProjectsLocationsIndexEndpoints');
|
---|