api_fuzzer.proto 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. // Copyright 2021 gRPC authors.
  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. syntax = "proto3";
  15. package api_fuzzer;
  16. message Empty {}
  17. message ByteSlice {
  18. reserved 2;
  19. reserved "intern";
  20. bytes value = 1;
  21. }
  22. message StringSlice {
  23. reserved 2;
  24. reserved "intern";
  25. string value = 1;
  26. }
  27. message ResourceQuota {}
  28. message ChannelArg {
  29. string key = 1;
  30. oneof value {
  31. string str = 2;
  32. int64 i = 3;
  33. ResourceQuota resource_quota = 4;
  34. }
  35. }
  36. message CredArtifact {
  37. oneof type {
  38. string custom = 1;
  39. int32 builtin = 2;
  40. }
  41. }
  42. message SslChannelCreds {
  43. CredArtifact root_certs = 1;
  44. CredArtifact private_key = 2;
  45. CredArtifact certs = 3;
  46. }
  47. message CompositeCallCreds {
  48. repeated CallCreds call_creds = 1;
  49. }
  50. message IAM {
  51. string auth_token = 1;
  52. string auth_selector = 2;
  53. }
  54. message CallCreds {
  55. oneof type {
  56. CompositeCallCreds composite_call_creds = 1;
  57. string access_token = 2;
  58. IAM iam = 3;
  59. Empty null = 4;
  60. }
  61. }
  62. message CompositeChannelCreds {
  63. ChannelCreds channel_creds = 1;
  64. CallCreds call_creds = 2;
  65. }
  66. message ChannelCreds {
  67. oneof type {
  68. SslChannelCreds ssl_channel_creds = 1;
  69. CompositeChannelCreds composite_channel_creds = 2;
  70. Empty null = 3;
  71. }
  72. }
  73. message Metadatum {
  74. StringSlice key = 1;
  75. ByteSlice value = 2;
  76. }
  77. message ChannelAction {
  78. uint64 add_n_bytes_writable = 1;
  79. uint64 add_n_bytes_readable = 2;
  80. uint64 wait_ms = 3;
  81. }
  82. message CreateChannel {
  83. string target = 1;
  84. repeated ChannelArg channel_args = 2;
  85. ChannelCreds channel_creds = 3;
  86. repeated ChannelAction channel_actions = 4;
  87. }
  88. message CreateServer {
  89. repeated ChannelArg channel_args = 1;
  90. }
  91. message CreateCall {
  92. uint32 propagation_mask = 1;
  93. StringSlice method = 2;
  94. StringSlice host = 3;
  95. int32 timeout = 4;
  96. }
  97. message SendInitialMetadata {
  98. repeated Metadatum metadata = 1;
  99. }
  100. message SendMessage {
  101. repeated ByteSlice message = 1;
  102. }
  103. message SendCloseFromClient {
  104. }
  105. message SendStatusFromServer {
  106. repeated Metadatum metadata = 1;
  107. uint32 status_code = 2;
  108. ByteSlice status_details = 3;
  109. }
  110. message ReceiveInitialMetadata {
  111. }
  112. message ReceiveMessage {
  113. }
  114. message ReceiveStatusOnClient {
  115. }
  116. message ReceiveCloseOnServer {
  117. }
  118. message BatchOp {
  119. oneof op {
  120. SendInitialMetadata send_initial_metadata = 1;
  121. SendMessage send_message = 2;
  122. SendCloseFromClient send_close_from_client = 3;
  123. SendStatusFromServer send_status_from_server = 4;
  124. ReceiveInitialMetadata receive_initial_metadata = 5;
  125. ReceiveMessage receive_message = 6;
  126. ReceiveStatusOnClient receive_status_on_client = 7;
  127. ReceiveCloseOnServer receive_close_on_server = 8;
  128. }
  129. uint32 flags = 100;
  130. }
  131. message Batch {
  132. repeated BatchOp operations = 1;
  133. }
  134. message Action {
  135. oneof type {
  136. Empty poll_cq = 1;
  137. uint32 advance_time = 2;
  138. CreateChannel create_channel = 3;
  139. Empty close_channel = 4;
  140. CreateServer create_server = 5;
  141. Empty shutdown_server = 6;
  142. Empty cancel_all_calls_if_shutdown = 7;
  143. Empty destroy_server_if_ready = 8;
  144. bool check_connectivity = 9;
  145. uint32 watch_connectivity = 10;
  146. CreateCall create_call = 11;
  147. Empty change_active_call = 12;
  148. Batch queue_batch = 13;
  149. Empty cancel_call = 14;
  150. Empty get_peer = 15;
  151. Empty get_target = 16;
  152. Empty ping = 17;
  153. string enable_tracer = 18;
  154. string disable_tracer = 19;
  155. Empty request_call = 20;
  156. Empty destroy_call = 21;
  157. uint32 resize_resource_quota = 22;
  158. }
  159. }
  160. message Msg {
  161. repeated Action actions = 1;
  162. }