1/* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17syntax = "proto3"; 18 19package com.android.federatedcompute.proto; 20 21import "common.proto"; 22 23option java_package = "com.android.federatedcompute.proto"; 24option java_multiple_files = true; 25 26service Aggregations { 27 // A request sent by the client after completing local (on-device) task 28 // execution to notify the server that it has Aggregation data to upload. The 29 // server responds with the location at which to upload the data. If a 30 // client's result is no longer needed (e.g. the reporting goal was already 31 // reached for the task), the server will respond with an ABORTED error in the 32 // operation status. 33 rpc StartAggregationDataUpload(StartAggregationDataUploadRequest) 34 returns (StartAggregationDataUploadResponse) {} 35 36 // A request sent by the client indicating the successful completion of the 37 // client's aggregation session. If a client's result is not needed for the 38 // aggregation (e.g. the reporting goal was already reached for the task), the 39 // server will respond with an ABORTED error. 40 // 41 // Clients should use the `ForwardingInfo` from the 42 // `StartAggregationDataUploadResponse.aggregation_protocol_forwarding_info` 43 // response field to construct the URI for this request. 44 rpc SubmitAggregationResult(SubmitAggregationResultRequest) 45 returns (SubmitAggregationResultResponse) {} 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 66message StartAggregationDataUploadRequest { 67 // The id of the aggregation session this client participates in. This value 68 // was returned by the server when the client was assigned a task. 69 // 70 // Note that HTTP clients set this value in the request URL instead of the 71 // request body. 72 string aggregation_id = 1; 73 74 // The authorization token returned by the server when the client was assigned 75 // a task. 76 // 77 // Note that HTTP clients set this value in the request URL instead of the 78 // request body. 79 string authorization_token = 2; 80} 81 82message StartAggregationDataUploadResponse { 83 // Information to construct the URI to use for continuing the aggregation 84 // protocol after the data is uploaded. 85 ForwardingInfo aggregation_protocol_forwarding_info = 1; 86 87 // Information about where to upload aggregation result data. 88 ByteStreamResource resource = 2; 89 90 // Unique token that the client must include in the subsequent protocol 91 // requests. 92 string client_token = 3; 93} 94 95message SubmitAggregationResultRequest { 96 // The id of the aggregation session this client participates in. This value 97 // was returned by the server when the client was assigned a task. 98 // 99 // Note that HTTP clients set this value in the request URL instead of the 100 // request body. 101 string aggregation_id = 1; 102 103 // The client token returned by the server when the client was assigned a 104 // task. 105 // 106 // Note that HTTP clients set this value in the request URL instead of the 107 // request body. 108 string client_token = 2; 109 110 // Name of the resource to which the aggregration result was uploaded. 111 string resource_name = 3; 112} 113 114message SubmitAggregationResultResponse {} 115 116message AbortAggregationRequest { 117 // The id of the aggregation session this client participates in. This value 118 // was returned by the server when the client was assigned a task. 119 // 120 // Note that HTTP clients set this value in the request URL instead of the 121 // request body. 122 string aggregation_id = 1; 123 124 // The client token returned by the server when the client was assigned a 125 // task. 126 // 127 // Note that HTTP clients set this value in the request URL instead of the 128 // request body. 129 string client_token = 2; 130 131 // Status code and optional message for why the aggregation was aborted. 132 Status status = 3; 133} 134 135message AbortAggregationResponse {} 136