xref: /aosp_15_r20/external/googleapis/google/cloud/visionai/v1alpha1/lva_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.visionai.v1alpha1;
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/visionai/v1alpha1/lva_resources.proto";
24import "google/longrunning/operations.proto";
25import "google/protobuf/field_mask.proto";
26
27option csharp_namespace = "Google.Cloud.VisionAI.V1Alpha1";
28option go_package = "cloud.google.com/go/visionai/apiv1alpha1/visionaipb;visionaipb";
29option java_multiple_files = true;
30option java_outer_classname = "LvaServiceProto";
31option java_package = "com.google.cloud.visionai.v1alpha1";
32option php_namespace = "Google\\Cloud\\VisionAI\\V1alpha1";
33option ruby_package = "Google::Cloud::VisionAI::V1alpha1";
34
35// Service describing handlers for resources. The service enables clients to run
36// Live Video Analytics (LVA) on the streaming inputs.
37service LiveVideoAnalytics {
38  option (google.api.default_host) = "visionai.googleapis.com";
39  option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
40
41  // Lists Analyses in a given project and location.
42  rpc ListAnalyses(ListAnalysesRequest) returns (ListAnalysesResponse) {
43    option (google.api.http) = {
44      get: "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/analyses"
45    };
46    option (google.api.method_signature) = "parent";
47  }
48
49  // Gets details of a single Analysis.
50  rpc GetAnalysis(GetAnalysisRequest) returns (Analysis) {
51    option (google.api.http) = {
52      get: "/v1alpha1/{name=projects/*/locations/*/clusters/*/analyses/*}"
53    };
54    option (google.api.method_signature) = "name";
55  }
56
57  // Creates a new Analysis in a given project and location.
58  rpc CreateAnalysis(CreateAnalysisRequest) returns (google.longrunning.Operation) {
59    option (google.api.http) = {
60      post: "/v1alpha1/{parent=projects/*/locations/*/clusters/*}/analyses"
61      body: "analysis"
62    };
63    option (google.api.method_signature) = "parent,analysis,analysis_id";
64    option (google.longrunning.operation_info) = {
65      response_type: "Analysis"
66      metadata_type: "OperationMetadata"
67    };
68  }
69
70  // Updates the parameters of a single Analysis.
71  rpc UpdateAnalysis(UpdateAnalysisRequest) returns (google.longrunning.Operation) {
72    option (google.api.http) = {
73      patch: "/v1alpha1/{analysis.name=projects/*/locations/*/clusters/*/analyses/*}"
74      body: "analysis"
75    };
76    option (google.api.method_signature) = "analysis,update_mask";
77    option (google.longrunning.operation_info) = {
78      response_type: "Analysis"
79      metadata_type: "OperationMetadata"
80    };
81  }
82
83  // Deletes a single Analysis.
84  rpc DeleteAnalysis(DeleteAnalysisRequest) returns (google.longrunning.Operation) {
85    option (google.api.http) = {
86      delete: "/v1alpha1/{name=projects/*/locations/*/clusters/*/analyses/*}"
87    };
88    option (google.api.method_signature) = "name";
89    option (google.longrunning.operation_info) = {
90      response_type: "google.protobuf.Empty"
91      metadata_type: "OperationMetadata"
92    };
93  }
94}
95
96// Message for requesting list of Analyses
97message ListAnalysesRequest {
98  // Required. Parent value for ListAnalysesRequest
99  string parent = 1 [
100    (google.api.field_behavior) = REQUIRED,
101    (google.api.resource_reference) = {
102      type: "visionai.googleapis.com/Cluster"
103    }
104  ];
105
106  // Requested page size. Server may return fewer items than requested.
107  // If unspecified, server will pick an appropriate default.
108  int32 page_size = 2;
109
110  // A token identifying a page of results the server should return.
111  string page_token = 3;
112
113  // Filtering results
114  string filter = 4;
115
116  // Hint for how to order the results
117  string order_by = 5;
118}
119
120// Message for response to listing Analyses
121message ListAnalysesResponse {
122  // The list of Analysis
123  repeated Analysis analyses = 1;
124
125  // A token identifying a page of results the server should return.
126  string next_page_token = 2;
127
128  // Locations that could not be reached.
129  repeated string unreachable = 3;
130}
131
132// Message for getting an Analysis.
133message GetAnalysisRequest {
134  // Required. Name of the resource.
135  string name = 1 [
136    (google.api.field_behavior) = REQUIRED,
137    (google.api.resource_reference) = {
138      type: "visionai.googleapis.com/Analysis"
139    }
140  ];
141}
142
143// Message for creating an Analysis.
144message CreateAnalysisRequest {
145  // Required. Value for parent.
146  string parent = 1 [
147    (google.api.field_behavior) = REQUIRED,
148    (google.api.resource_reference) = {
149      type: "visionai.googleapis.com/Cluster"
150    }
151  ];
152
153  // Required. Id of the requesting object.
154  string analysis_id = 2 [(google.api.field_behavior) = REQUIRED];
155
156  // Required. The resource being created.
157  Analysis analysis = 3 [(google.api.field_behavior) = REQUIRED];
158
159  // Optional. An optional request ID to identify requests. Specify a unique request ID
160  // so that if you must retry your request, the server will know to ignore
161  // the request if it has already been completed. The server will guarantee
162  // that for at least 60 minutes since the first request.
163  //
164  // For example, consider a situation where you make an initial request and the
165  // request times out. If you make the request again with the same request ID,
166  // the server can check if original operation with the same request ID was
167  // received, and if so, will ignore the second request. This prevents clients
168  // from accidentally creating duplicate commitments.
169  //
170  // The request ID must be a valid UUID with the exception that zero UUID is
171  // not supported (00000000-0000-0000-0000-000000000000).
172  string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
173}
174
175// Message for updating an Analysis.
176message UpdateAnalysisRequest {
177  // Required. Field mask is used to specify the fields to be overwritten in the
178  // Analysis resource by the update.
179  // The fields specified in the update_mask are relative to the resource, not
180  // the full request. A field will be overwritten if it is in the mask. If the
181  // user does not provide a mask then all fields will be overwritten.
182  google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED];
183
184  // Required. The resource being updated.
185  Analysis analysis = 2 [(google.api.field_behavior) = REQUIRED];
186
187  // Optional. An optional request ID to identify requests. Specify a unique request ID
188  // so that if you must retry your request, the server will know to ignore
189  // the request if it has already been completed. The server will guarantee
190  // that for at least 60 minutes since the first request.
191  //
192  // For example, consider a situation where you make an initial request and the
193  // request times out. If you make the request again with the same request ID,
194  // the server can check if original operation with the same request ID was
195  // received, and if so, will ignore the second request. This prevents clients
196  // from accidentally creating duplicate commitments.
197  //
198  // The request ID must be a valid UUID with the exception that zero UUID is
199  // not supported (00000000-0000-0000-0000-000000000000).
200  string request_id = 3 [(google.api.field_behavior) = OPTIONAL];
201}
202
203// Message for deleting an Analysis.
204message DeleteAnalysisRequest {
205  // Required. Name of the resource.
206  string name = 1 [
207    (google.api.field_behavior) = REQUIRED,
208    (google.api.resource_reference) = {
209      type: "visionai.googleapis.com/Analysis"
210    }
211  ];
212
213  // Optional. An optional request ID to identify requests. Specify a unique request ID
214  // so that if you must retry your request, the server will know to ignore
215  // the request if it has already been completed. The server will guarantee
216  // that for at least 60 minutes after the first request.
217  //
218  // For example, consider a situation where you make an initial request and the
219  // request times out. If you make the request again with the same request ID,
220  // the server can check if original operation with the same request ID was
221  // received, and if so, will ignore the second request. This prevents clients
222  // from accidentally creating duplicate commitments.
223  //
224  // The request ID must be a valid UUID with the exception that zero UUID is
225  // not supported (00000000-0000-0000-0000-000000000000).
226  string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
227}
228