blob: 193b6c4171288c6968d29625f22d61229ceba3aa [file] [log] [blame]
Craig Tillerad1fd3a2015-02-16 12:23:04 -08001
2// Copyright 2015, Google Inc.
3// All rights reserved.
Craig Tillerce5021b2015-02-18 09:25:21 -08004//
Craig Tillerad1fd3a2015-02-16 12:23:04 -08005// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are
7// met:
Craig Tillerce5021b2015-02-18 09:25:21 -08008//
Craig Tillerad1fd3a2015-02-16 12:23:04 -08009// * Redistributions of source code must retain the above copyright
10// notice, this list of conditions and the following disclaimer.
11// * Redistributions in binary form must reproduce the above
12// copyright notice, this list of conditions and the following disclaimer
13// in the documentation and/or other materials provided with the
14// distribution.
15// * Neither the name of Google Inc. nor the names of its
16// contributors may be used to endorse or promote products derived from
17// this software without specific prior written permission.
Craig Tillerce5021b2015-02-18 09:25:21 -080018//
Craig Tillerad1fd3a2015-02-16 12:23:04 -080019// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
chenwa8fd44a2014-12-10 15:13:55 -080031// Message definitions to be used by integration test service definitions.
32
yang-gf6befe82015-08-13 13:51:53 -070033syntax = "proto3";
chenwa8fd44a2014-12-10 15:13:55 -080034
35package grpc.testing;
36
37// The type of payload that should be returned.
38enum PayloadType {
39 // Compressable text format.
40 COMPRESSABLE = 0;
41
42 // Uncompressable binary format.
43 UNCOMPRESSABLE = 1;
44
45 // Randomly chosen from all other formats defined in this enum.
46 RANDOM = 2;
47}
48
Abhishek Kumar905a65b2015-06-19 15:28:07 -070049// Compression algorithms
50enum CompressionType {
51 // No compression
52 NONE = 0;
53 GZIP = 1;
54 DEFLATE = 2;
55}
56
chenwa8fd44a2014-12-10 15:13:55 -080057// A block of data, to simply increase gRPC message size.
58message Payload {
59 // The type of data in body.
yang-gf6befe82015-08-13 13:51:53 -070060 PayloadType type = 1;
chenwa8fd44a2014-12-10 15:13:55 -080061 // Primary contents of payload.
yang-gf6befe82015-08-13 13:51:53 -070062 bytes body = 2;
chenwa8fd44a2014-12-10 15:13:55 -080063}
64
Abhishek Kumar905a65b2015-06-19 15:28:07 -070065// A protobuf representation for grpc status. This is used by test
66// clients to specify a status that the server should attempt to return.
yang-gf6befe82015-08-13 13:51:53 -070067message EchoStatus {
68 int32 code = 1;
69 string message = 2;
Abhishek Kumar905a65b2015-06-19 15:28:07 -070070}
71
chenwa8fd44a2014-12-10 15:13:55 -080072// Unary request.
73message SimpleRequest {
74 // Desired payload type in the response from the server.
75 // If response_type is RANDOM, server randomly chooses one from other formats.
yang-gf6befe82015-08-13 13:51:53 -070076 PayloadType response_type = 1;
chenwa8fd44a2014-12-10 15:13:55 -080077
78 // Desired payload size in the response from the server.
79 // If response_type is COMPRESSABLE, this denotes the size before compression.
yang-gf6befe82015-08-13 13:51:53 -070080 int32 response_size = 2;
chenwa8fd44a2014-12-10 15:13:55 -080081
82 // Optional input payload sent along with the request.
yang-gf6befe82015-08-13 13:51:53 -070083 Payload payload = 3;
Yang Gao94e97ef2015-01-25 22:33:54 -080084
85 // Whether SimpleResponse should include username.
yang-gf6befe82015-08-13 13:51:53 -070086 bool fill_username = 4;
Yang Gao94e97ef2015-01-25 22:33:54 -080087
88 // Whether SimpleResponse should include OAuth scope.
yang-gf6befe82015-08-13 13:51:53 -070089 bool fill_oauth_scope = 5;
Abhishek Kumar905a65b2015-06-19 15:28:07 -070090
91 // Compression algorithm to be used by the server for the response (stream)
yang-gf6befe82015-08-13 13:51:53 -070092 CompressionType response_compression = 6;
Abhishek Kumar905a65b2015-06-19 15:28:07 -070093
94 // Whether server should return a given status
yang-gf6befe82015-08-13 13:51:53 -070095 EchoStatus response_status = 7;
chenwa8fd44a2014-12-10 15:13:55 -080096}
97
98// Unary response, as configured by the request.
99message SimpleResponse {
100 // Payload to increase message size.
yang-gf6befe82015-08-13 13:51:53 -0700101 Payload payload = 1;
chenwa8fd44a2014-12-10 15:13:55 -0800102 // The user the request came from, for verifying authentication was
103 // successful when the client expected it.
yang-gf6befe82015-08-13 13:51:53 -0700104 string username = 2;
Yang Gao94e97ef2015-01-25 22:33:54 -0800105 // OAuth scope.
yang-gf6befe82015-08-13 13:51:53 -0700106 string oauth_scope = 3;
chenwa8fd44a2014-12-10 15:13:55 -0800107}
108
109// Client-streaming request.
110message StreamingInputCallRequest {
111 // Optional input payload sent along with the request.
yang-gf6befe82015-08-13 13:51:53 -0700112 Payload payload = 1;
chenwa8fd44a2014-12-10 15:13:55 -0800113
114 // Not expecting any payload from the response.
115}
116
117// Client-streaming response.
118message StreamingInputCallResponse {
119 // Aggregated size of payloads received from the client.
yang-gf6befe82015-08-13 13:51:53 -0700120 int32 aggregated_payload_size = 1;
chenwa8fd44a2014-12-10 15:13:55 -0800121}
122
123// Configuration for a particular response.
124message ResponseParameters {
125 // Desired payload sizes in responses from the server.
126 // If response_type is COMPRESSABLE, this denotes the size before compression.
yang-gf6befe82015-08-13 13:51:53 -0700127 int32 size = 1;
chenwa8fd44a2014-12-10 15:13:55 -0800128
129 // Desired interval between consecutive responses in the response stream in
130 // microseconds.
yang-gf6befe82015-08-13 13:51:53 -0700131 int32 interval_us = 2;
chenwa8fd44a2014-12-10 15:13:55 -0800132}
133
134// Server-streaming request.
135message StreamingOutputCallRequest {
136 // Desired payload type in the response from the server.
137 // If response_type is RANDOM, the payload from each response in the stream
138 // might be of different types. This is to simulate a mixed type of payload
139 // stream.
yang-gf6befe82015-08-13 13:51:53 -0700140 PayloadType response_type = 1;
chenwa8fd44a2014-12-10 15:13:55 -0800141
142 // Configuration for each expected response message.
143 repeated ResponseParameters response_parameters = 2;
144
145 // Optional input payload sent along with the request.
yang-gf6befe82015-08-13 13:51:53 -0700146 Payload payload = 3;
Abhishek Kumar905a65b2015-06-19 15:28:07 -0700147
148 // Compression algorithm to be used by the server for the response (stream)
yang-gf6befe82015-08-13 13:51:53 -0700149 CompressionType response_compression = 6;
Abhishek Kumar905a65b2015-06-19 15:28:07 -0700150
151 // Whether server should return a given status
yang-gf6befe82015-08-13 13:51:53 -0700152 EchoStatus response_status = 7;
chenwa8fd44a2014-12-10 15:13:55 -0800153}
154
155// Server-streaming response, as configured by the request and parameters.
156message StreamingOutputCallResponse {
157 // Payload to increase response size.
yang-gf6befe82015-08-13 13:51:53 -0700158 Payload payload = 1;
chenwa8fd44a2014-12-10 15:13:55 -0800159}
yang-gc9c69e22015-07-24 14:38:26 -0700160
161// For reconnect interop test only.
162// Server tells client whether its reconnects are following the spec and the
163// reconnect backoffs it saw.
164message ReconnectInfo {
yang-gf6befe82015-08-13 13:51:53 -0700165 bool passed = 1;
yang-gc9c69e22015-07-24 14:38:26 -0700166 repeated int32 backoff_ms = 2;
167}