xref: /aosp_15_r20/external/googleapis/google/cloud/discoveryengine/v1beta/engine_service.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2022 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.discoveryengine.v1beta;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/cloud/discoveryengine/v1beta/engine.proto";
24import "google/longrunning/operations.proto";
25import "google/protobuf/empty.proto";
26import "google/protobuf/field_mask.proto";
27import "google/protobuf/timestamp.proto";
28
29option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
30option go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb";
31option java_multiple_files = true;
32option java_outer_classname = "EngineServiceProto";
33option java_package = "com.google.cloud.discoveryengine.v1beta";
34option objc_class_prefix = "DISCOVERYENGINE";
35option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
36option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
37
38// Service for managing [Engine][google.cloud.discoveryengine.v1beta.Engine]
39// configuration.
40service EngineService {
41  option (google.api.default_host) = "discoveryengine.googleapis.com";
42  option (google.api.oauth_scopes) =
43      "https://www.googleapis.com/auth/cloud-platform";
44
45  // Creates a [Engine][google.cloud.discoveryengine.v1beta.Engine].
46  rpc CreateEngine(CreateEngineRequest) returns (google.longrunning.Operation) {
47    option (google.api.http) = {
48      post: "/v1beta/{parent=projects/*/locations/*/collections/*}/engines"
49      body: "engine"
50    };
51    option (google.api.method_signature) = "parent,engine,engine_id";
52    option (google.longrunning.operation_info) = {
53      response_type: "google.cloud.discoveryengine.v1beta.Engine"
54      metadata_type: "google.cloud.discoveryengine.v1beta.CreateEngineMetadata"
55    };
56  }
57
58  // Deletes a [Engine][google.cloud.discoveryengine.v1beta.Engine].
59  rpc DeleteEngine(DeleteEngineRequest) returns (google.longrunning.Operation) {
60    option (google.api.http) = {
61      delete: "/v1beta/{name=projects/*/locations/*/collections/*/engines/*}"
62    };
63    option (google.api.method_signature) = "name";
64    option (google.longrunning.operation_info) = {
65      response_type: "google.protobuf.Empty"
66      metadata_type: "google.cloud.discoveryengine.v1beta.DeleteEngineMetadata"
67    };
68  }
69
70  // Updates an [Engine][google.cloud.discoveryengine.v1beta.Engine]
71  rpc UpdateEngine(UpdateEngineRequest) returns (Engine) {
72    option (google.api.http) = {
73      patch: "/v1beta/{engine.name=projects/*/locations/*/collections/*/engines/*}"
74      body: "engine"
75    };
76    option (google.api.method_signature) = "engine,update_mask";
77  }
78
79  // Gets a [Engine][google.cloud.discoveryengine.v1beta.Engine].
80  rpc GetEngine(GetEngineRequest) returns (Engine) {
81    option (google.api.http) = {
82      get: "/v1beta/{name=projects/*/locations/*/collections/*/engines/*}"
83    };
84    option (google.api.method_signature) = "name";
85  }
86
87  // Lists all the [Engine][google.cloud.discoveryengine.v1beta.Engine]s
88  // associated with the project.
89  rpc ListEngines(ListEnginesRequest) returns (ListEnginesResponse) {
90    option (google.api.http) = {
91      get: "/v1beta/{parent=projects/*/locations/*/collections/*}/engines"
92    };
93    option (google.api.method_signature) = "parent";
94  }
95
96  // Pauses the training of an existing engine. Only applicable if
97  // [SolutionType][google.cloud.discoveryengine.v1beta.SolutionType] is
98  // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
99  rpc PauseEngine(PauseEngineRequest) returns (Engine) {
100    option (google.api.http) = {
101      post: "/v1beta/{name=projects/*/locations/*/collections/*/engines/*}:pause"
102      body: "*"
103    };
104    option (google.api.method_signature) = "name";
105  }
106
107  // Resumes the training of an existing engine. Only applicable if
108  // [SolutionType][google.cloud.discoveryengine.v1beta.SolutionType] is
109  // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
110  rpc ResumeEngine(ResumeEngineRequest) returns (Engine) {
111    option (google.api.http) = {
112      post: "/v1beta/{name=projects/*/locations/*/collections/*/engines/*}:resume"
113      body: "*"
114    };
115    option (google.api.method_signature) = "name";
116  }
117
118  // Tunes an existing engine. Only applicable if
119  // [SolutionType][google.cloud.discoveryengine.v1beta.SolutionType] is
120  // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
121  rpc TuneEngine(TuneEngineRequest) returns (google.longrunning.Operation) {
122    option (google.api.http) = {
123      post: "/v1beta/{name=projects/*/locations/*/collections/*/engines/*}:tune"
124      body: "*"
125    };
126    option (google.api.method_signature) = "name";
127    option (google.longrunning.operation_info) = {
128      response_type: "TuneEngineResponse"
129      metadata_type: "TuneEngineMetadata"
130    };
131  }
132}
133
134// Request for
135// [EngineService.CreateEngine][google.cloud.discoveryengine.v1beta.EngineService.CreateEngine]
136// method.
137message CreateEngineRequest {
138  // Required. The parent resource name, such as
139  // `projects/{project}/locations/{location}/collections/{collection}`.
140  string parent = 1 [
141    (google.api.field_behavior) = REQUIRED,
142    (google.api.resource_reference) = {
143      type: "discoveryengine.googleapis.com/Collection"
144    }
145  ];
146
147  // Required. The [Engine][google.cloud.discoveryengine.v1beta.Engine] to
148  // create.
149  Engine engine = 2 [(google.api.field_behavior) = REQUIRED];
150
151  // Required. The ID to use for the
152  // [Engine][google.cloud.discoveryengine.v1beta.Engine], which will become the
153  // final component of the
154  // [Engine][google.cloud.discoveryengine.v1beta.Engine]'s resource name.
155  //
156  // This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
157  // standard with a length limit of 63 characters. Otherwise, an
158  // INVALID_ARGUMENT error is returned.
159  string engine_id = 3 [(google.api.field_behavior) = REQUIRED];
160}
161
162// Metadata related to the progress of the
163// [EngineService.CreateEngine][google.cloud.discoveryengine.v1beta.EngineService.CreateEngine]
164// operation. This will be returned by the google.longrunning.Operation.metadata
165// field.
166message CreateEngineMetadata {
167  // Operation create time.
168  google.protobuf.Timestamp create_time = 1;
169
170  // Operation last update time. If the operation is done, this is also the
171  // finish time.
172  google.protobuf.Timestamp update_time = 2;
173}
174
175// Request message for
176// [EngineService.DeleteEngine][google.cloud.discoveryengine.v1beta.EngineService.DeleteEngine]
177// method.
178message DeleteEngineRequest {
179  // Required. Full resource name of
180  // [Engine][google.cloud.discoveryengine.v1beta.Engine], such as
181  // `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`.
182  //
183  // If the caller does not have permission to delete the
184  // [Engine][google.cloud.discoveryengine.v1beta.Engine], regardless of whether
185  // or not it exists, a PERMISSION_DENIED error is returned.
186  //
187  // If the [Engine][google.cloud.discoveryengine.v1beta.Engine] to delete does
188  // not exist, a NOT_FOUND error is returned.
189  string name = 1 [
190    (google.api.field_behavior) = REQUIRED,
191    (google.api.resource_reference) = {
192      type: "discoveryengine.googleapis.com/Engine"
193    }
194  ];
195}
196
197// Metadata related to the progress of the
198// [EngineService.DeleteEngine][google.cloud.discoveryengine.v1beta.EngineService.DeleteEngine]
199// operation. This will be returned by the google.longrunning.Operation.metadata
200// field.
201message DeleteEngineMetadata {
202  // Operation create time.
203  google.protobuf.Timestamp create_time = 1;
204
205  // Operation last update time. If the operation is done, this is also the
206  // finish time.
207  google.protobuf.Timestamp update_time = 2;
208}
209
210// Request message for
211// [EngineService.GetEngine][google.cloud.discoveryengine.v1beta.EngineService.GetEngine]
212// method.
213message GetEngineRequest {
214  // Required. Full resource name of
215  // [Engine][google.cloud.discoveryengine.v1beta.Engine], such as
216  // `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`.
217  string name = 1 [
218    (google.api.field_behavior) = REQUIRED,
219    (google.api.resource_reference) = {
220      type: "discoveryengine.googleapis.com/Engine"
221    }
222  ];
223}
224
225// Request message for
226// [EngineService.ListEngines][google.cloud.discoveryengine.v1beta.EngineService.ListEngines]
227// method.
228message ListEnginesRequest {
229  // Required. The parent resource name, such as
230  // `projects/{project}/locations/{location}/collections/{collection_id}`.
231  string parent = 1 [
232    (google.api.field_behavior) = REQUIRED,
233    (google.api.resource_reference) = {
234      type: "discoveryengine.googleapis.com/Collection"
235    }
236  ];
237
238  // Optional. Not supported.
239  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
240
241  // Optional. Not supported.
242  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
243
244  // Optional. Filter by solution type. For example:
245  // solution_type=SOLUTION_TYPE_SEARCH
246  string filter = 4 [(google.api.field_behavior) = OPTIONAL];
247}
248
249// Response message for
250// [EngineService.ListEngines][google.cloud.discoveryengine.v1beta.EngineService.ListEngines]
251// method.
252message ListEnginesResponse {
253  // All the customer's [Engine][google.cloud.discoveryengine.v1beta.Engine]s.
254  repeated Engine engines = 1;
255
256  // Not supported.
257  string next_page_token = 2;
258}
259
260// Request message for
261// [EngineService.UpdateEngine][google.cloud.discoveryengine.v1beta.EngineService.UpdateEngine]
262// method.
263message UpdateEngineRequest {
264  // Required. The [Engine][google.cloud.discoveryengine.v1beta.Engine] to
265  // update.
266  //
267  // If the caller does not have permission to update the
268  // [Engine][google.cloud.discoveryengine.v1beta.Engine], regardless of whether
269  // or not it exists, a PERMISSION_DENIED error is returned.
270  //
271  // If the [Engine][google.cloud.discoveryengine.v1beta.Engine] to update does
272  // not exist, a NOT_FOUND error is returned.
273  Engine engine = 1 [(google.api.field_behavior) = REQUIRED];
274
275  // Indicates which fields in the provided
276  // [Engine][google.cloud.discoveryengine.v1beta.Engine] to update.
277  //
278  // If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
279  // is returned.
280  google.protobuf.FieldMask update_mask = 2;
281}
282
283// Request for pausing training of an engine.
284message PauseEngineRequest {
285  // Required. The name of the engine to pause.
286  // Format:
287  // `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`
288  string name = 1 [
289    (google.api.field_behavior) = REQUIRED,
290    (google.api.resource_reference) = {
291      type: "discoveryengine.googleapis.com/Engine"
292    }
293  ];
294}
295
296// Request for resuming training of an engine.
297message ResumeEngineRequest {
298  // Required. The name of the engine to resume.
299  // Format:
300  // `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`
301  string name = 1 [
302    (google.api.field_behavior) = REQUIRED,
303    (google.api.resource_reference) = {
304      type: "discoveryengine.googleapis.com/Engine"
305    }
306  ];
307}
308
309// Request to manually start a tuning process now (instead of waiting for
310// the periodically scheduled tuning to happen).
311message TuneEngineRequest {
312  // Required. The resource name of the engine to tune.
313  // Format:
314  // `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`
315  string name = 1 [
316    (google.api.field_behavior) = REQUIRED,
317    (google.api.resource_reference) = {
318      type: "discoveryengine.googleapis.com/Engine"
319    }
320  ];
321}
322
323// Metadata associated with a tune operation.
324message TuneEngineMetadata {
325  // Required. The resource name of the engine that this tune applies to.
326  // Format:
327  // `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`
328  string engine = 1 [
329    (google.api.field_behavior) = REQUIRED,
330    (google.api.resource_reference) = {
331      type: "discoveryengine.googleapis.com/Engine"
332    }
333  ];
334}
335
336// Response associated with a tune operation.
337message TuneEngineResponse {}
338