xref: /aosp_15_r20/external/federated-compute/fcp/protos/federatedcompute/aggregations.proto (revision 14675a029014e728ec732f129a32e299b2da0601)
1// Copyright 2021 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.internal.federatedcompute.v1;
18
19import "fcp/protos/federatedcompute/common.proto";
20
21option java_package = "com.google.internal.federatedcompute.v1";
22option java_multiple_files = true;
23
24service Aggregations {
25  // A request sent by the client after completing local (on-device) task
26  // execution to notify the server that it has Aggregation data to upload. The
27  // server responds with the location at which to upload the data. If a
28  // client's result is no longer needed (e.g. the reporting goal was already
29  // reached for the task), the server will respond with an ABORTED error in the
30  // operation status.
31  rpc StartAggregationDataUpload(StartAggregationDataUploadRequest)
32      returns (StartAggregationDataUploadResponse) {
33  }
34
35  // A request sent by the client indicating the successful completion of the
36  // client's aggregation session. If a client's result is not needed for the
37  // aggregation (e.g. the reporting goal was already reached for the task), the
38  // server will respond with an ABORTED error.
39  //
40  // Clients should use the `ForwardingInfo` from the
41  // `StartAggregationDataUploadResponse.aggregation_protocol_forwarding_info`
42  // response field to construct the URI for this request.
43  rpc SubmitAggregationResult(SubmitAggregationResultRequest)
44      returns (SubmitAggregationResultResponse) {
45  }
46
47  // A request sent by the client indicating the client's aggregation session
48  // should be aborted.
49  //
50  // Clients must only call this if they've previously called
51  // `StartAggregationDataUpload`.
52  //
53  // Clients should not call this if one of the requests returned an Aborted
54  // status.
55  //
56  // If clients have already received a `StartAggregationDataUploadResponse`
57  // they should use the `ForwardingInfo` from the
58  // `StartAggregationDataUploadResponse.aggregation_protocol_forwarding_info`
59  // response field to construct the URI for this request. Otherwise, clients
60  // should use the same `ForwardingInfo` as was used to construct the
61  // `StartAggregationDataUpload` request URI.
62  rpc AbortAggregation(AbortAggregationRequest)
63      returns (AbortAggregationResponse) {
64  }
65}
66
67message StartAggregationDataUploadRequest {
68  // The id of the aggregation session this client participates in. This value
69  // was returned by the server when the client was assigned a task.
70  //
71  // Note that HTTP clients set this value in the request URL instead of the
72  // request body.
73  string aggregation_id = 1
74      ;
75
76  // The authorization token returned by the server when the client was assigned
77  // a task.
78  //
79  // Note that HTTP clients set this value in the request URL instead of the
80  // request body.
81  string authorization_token = 2
82      ;
83}
84
85message StartAggregationDataUploadMetadata {}
86
87message StartAggregationDataUploadResponse {
88  // Information to construct the URI to use for continuing the aggregation
89  // protocol after the data is uploaded.
90  ForwardingInfo aggregation_protocol_forwarding_info = 1;
91
92  // Information about where to upload aggregation result data.
93  ByteStreamResource resource = 2;
94
95  // Unique token that the client must include in the subsequent protocol
96  // requests.
97  string client_token = 3;
98}
99
100message SubmitAggregationResultRequest {
101  // The id of the aggregation session this client participates in. This value
102  // was returned by the server when the client was assigned a task.
103  //
104  // Note that HTTP clients set this value in the request URL instead of the
105  // request body.
106  string aggregation_id = 1
107      ;
108
109  // The client token returned by the server when the client was assigned a
110  // task.
111  //
112  // Note that HTTP clients set this value in the request URL instead of the
113  // request body.
114  string client_token = 2
115      ;
116
117  // Name of the resource to which the aggregration result was uploaded.
118  string resource_name = 3;
119}
120
121message SubmitAggregationResultResponse {}
122
123message AbortAggregationRequest {
124  // The id of the aggregation session this client participates in. This value
125  // was returned by the server when the client was assigned a task.
126  //
127  // Note that HTTP clients set this value in the request URL instead of the
128  // request body.
129  string aggregation_id = 1
130      ;
131
132  // The client token returned by the server when the client was assigned a
133  // task.
134  //
135  // Note that HTTP clients set this value in the request URL instead of the
136  // request body.
137  string client_token = 2
138      ;
139
140  // Status code and optional message for why the aggregation was aborted.
141  Status status = 3;
142}
143
144message AbortAggregationResponse {}
145