zone.proto 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. syntax = "proto3";
  2. package cloudflareApi.zone;
  3. option go_package = "./cloudflareApi/zone";
  4. option java_multiple_files = true;
  5. option java_package = "io.grpc.cloudflare.zone";
  6. option java_outer_classname = "zoneProto";
  7. service ZoneCloudflare {
  8. //Zone CURD
  9. rpc ZoneIDByNameCloudflare (ZoneIDByNameRequestCloudflare) returns (ZoneIDByNameReplyCloudflare) {}
  10. rpc ZoneDetails (ZoneDetailsRequestCloudflare) returns (ZoneDetailsReplyCloudflare){}
  11. rpc GetZones (GetZonesRequestCloudflare) returns (GetZonesReplyCloudflare){}
  12. rpc EditZone (EditZoneRequestCloudflare) returns (EditZoneReplyCloudflare){}
  13. rpc DeleteZone (DeleteZoneRequestCloudflare) returns (DeleteZoneReplyCloudflare){}
  14. rpc ListZones(ListZonesRequestCloudflare) returns (ZonesList){}
  15. rpc ListZonesByAccountId(ListZonesByAccountIdRequestCloudflare) returns (ZonesList){}
  16. rpc ActivationCheck(ActivationCheckRequestCloudflare) returns (ActivationCheckReplyCloudflare){}
  17. //PageRule CURD
  18. rpc ListPageRule(ListPageRuleRequestCloudflare) returns (PageRuleList){}
  19. rpc CreatePageRule(CreatePageRuleRequestCloudflare) returns (PageRule){}
  20. rpc UpdatePageRule(UpdatePageRuleRequestCloudflare) returns (PageRule){}
  21. rpc DeletePageRule(DeletePageRuleRequestCloudflare) returns (PageRule){}
  22. rpc UpdatePageRulesPriorities(UpdatePageRulesPrioritiesRequestCloudflare) returns(PageRuleList){}
  23. //RuleSet UR
  24. rpc UpdateRuleSet(UpdateRuleSetRequestCloudflare) returns (RuleList){}
  25. rpc GetRuleSet(GetRuleSetRequestCloudflare) returns (RuleList){}
  26. //Argo Smart Routing Setting UR
  27. rpc UpdateArgoSetting(UpdateArgoRequestCloudflare) returns(ArgoSetting){}
  28. rpc GetArgoSetting(IdRequest) returns(ArgoSetting){}
  29. rpc GetArgoSettingSubscription(IdRequest)returns(ArgoSetting){}
  30. rpc CreateArgoSettingSubscription(IdRequest)returns(ArgoSetting){}
  31. }
  32. //Zone CURD
  33. message ZoneCloudflareEntity{
  34. string id = 1;
  35. string name = 2;
  36. Plan plan = 3;
  37. Plan plan_pending = 4;
  38. string status = 5;
  39. bool paused = 6;
  40. string type = 7;
  41. string verification_key = 8;
  42. message Plan {
  43. string id = 1;
  44. string name = 2;
  45. sint64 price = 3;
  46. }
  47. }
  48. message ZoneIDByNameRequestCloudflare {
  49. string apiKey = 1;
  50. string apiEmail = 2;
  51. string zoneName = 3;
  52. }
  53. message ZoneIDByNameReplyCloudflare {
  54. string zoneId = 1;
  55. }
  56. message ZoneDetailsRequestCloudflare {
  57. string apiKey = 1;
  58. string apiEmail = 2;
  59. string zoneId = 3;
  60. }
  61. message ZoneDetailsReplyCloudflare{
  62. ZoneCloudflareEntity result = 1;
  63. }
  64. message GetZonesRequestCloudflare {
  65. string apiKey = 1;
  66. string apiEmail = 2;
  67. string domain = 3;
  68. }
  69. message GetZonesReplyCloudflare{
  70. repeated ZoneCloudflareEntity result = 1;
  71. bool success = 2;
  72. }
  73. message ListZonesRequestCloudflare {
  74. string apiKey = 1;
  75. string apiEmail = 2;
  76. }
  77. message ListZonesByAccountIdRequestCloudflare {
  78. string apiKey = 1;
  79. string apiEmail = 2;
  80. string accountId = 3;
  81. }
  82. message ZonesList{
  83. repeated ZoneCloudflareEntity result = 1;
  84. }
  85. message EditZoneRequestCloudflare {
  86. string apiKey = 1;
  87. string apiEmail = 2;
  88. string zoneId = 3;
  89. optional bool paused = 4;
  90. optional string planId = 5;
  91. optional string type = 6;
  92. }
  93. message EditZoneReplyCloudflare{
  94. ZoneCloudflareEntity result = 1;
  95. bool success = 2;
  96. }
  97. message DeleteZoneRequestCloudflare {
  98. string apiKey = 1;
  99. string apiEmail = 2;
  100. string zoneId = 3;
  101. }
  102. message DeleteZoneReplyCloudflare{
  103. bool success = 1;
  104. string id = 2;
  105. }
  106. message ActivationCheckRequestCloudflare {
  107. string apiKey = 1;
  108. string apiEmail = 2;
  109. string zoneId = 3;
  110. }
  111. message ActivationCheckReplyCloudflare{
  112. bool success = 1;
  113. }
  114. //PageRule CRUD
  115. message PageRule{
  116. optional string id = 1;
  117. string expression = 2;
  118. optional uint32 ttl = 3;
  119. optional string queryArgsType = 4;
  120. repeated string queryArgs = 5;
  121. optional string originHost = 6;
  122. optional uint32 originProtocol = 7;
  123. // int64 priority = 8;
  124. }
  125. message PageRuleList{
  126. repeated PageRule page_rules = 1;
  127. }
  128. message ListPageRuleRequestCloudflare{
  129. string apiKey = 1;
  130. string apiEmail = 2;
  131. string zoneId = 3;
  132. }
  133. message CreatePageRuleRequestCloudflare{
  134. string apiKey = 1;
  135. string apiEmail = 2;
  136. string zoneId = 3;
  137. PageRule page_rule = 4;
  138. }
  139. message UpdatePageRuleRequestCloudflare{
  140. string apiKey = 1;
  141. string apiEmail = 2;
  142. string zoneId = 3;
  143. PageRule page_rule = 4;
  144. }
  145. message DeletePageRuleRequestCloudflare{
  146. string apiKey = 1;
  147. string apiEmail = 2;
  148. string zoneId = 3;
  149. string page_rule_id = 4;
  150. }
  151. //RuleSet UR
  152. enum Phase{
  153. http_request_sanitize = 0; //URL 规范化
  154. http_request_transform = 1; //URL 重写规则
  155. // http_request_origin = 2; //起源规则
  156. // http_request_cache_settings = 3; //缓存规则
  157. // http_config_settings = 4; //配置规则
  158. // http_request_dynamic_redirect = 5; //动态重定向
  159. // ddos_l7 = 6; //HTTP DDoS 攻击防护
  160. // http_request_firewall_custom = 7; //Web 应用程序防火墙 (WAF)
  161. // http_ratelimit = 8; //限速规则
  162. // http_request_firewall_managed = 9; //Web 应用程序防火墙 (WAF)
  163. // http_request_sbfm = 10; //超级机器人战斗模式
  164. // http_request_redirect = 11; //批量重定向
  165. http_request_late_transform = 12; //HTTP 请求头修改规则
  166. // http_custom_errors = 13; //自定义错误响应
  167. http_response_headers_transform = 14; //HTTP响应头修改规则
  168. // http_response_firewall_managed = 15; //Cloudflare 敏感数据检测(数据丢失防护)
  169. // http_log_custom_fields = 16; //日志推送自定义字段
  170. }
  171. message Rule{
  172. string expression = 1;
  173. // optional uint32 ttl = 2;
  174. // optional string queryArgsType = 3;
  175. // repeated string queryArgs = 4;
  176. // optional string originHost = 5;
  177. optional string originPath = 6;
  178. // optional uint32 originProtocol = 7;
  179. map<string, string> requestHeader = 8;
  180. map<string, string> responseHeader = 9;
  181. }
  182. message RuleList{
  183. repeated Rule rules = 1;
  184. }
  185. message GetRuleSetRequestCloudflare{
  186. string apiKey = 1;
  187. string apiEmail = 2;
  188. string zoneId = 3;
  189. Phase phase = 4;
  190. }
  191. message UpdateRuleSetRequestCloudflare{
  192. string apiKey = 1;
  193. string apiEmail = 2;
  194. string zoneId = 3;
  195. Phase phase = 4;
  196. repeated Rule rules = 5;
  197. }
  198. message UpdatePageRulesPrioritiesStruct{
  199. string id = 1;
  200. int64 priority = 2;
  201. }
  202. message UpdatePageRulesPrioritiesRequestCloudflare{
  203. string apiKey = 1;
  204. string apiEmail = 2;
  205. string zoneId = 3;
  206. repeated UpdatePageRulesPrioritiesStruct data = 4;
  207. }
  208. message ArgoSetting{
  209. bool enabled = 1;
  210. }
  211. message UpdateArgoRequestCloudflare{
  212. string apiKey = 1;
  213. string apiEmail = 2;
  214. string zoneId = 3;
  215. ArgoSetting argo_setting = 4;
  216. }
  217. message IdRequest{
  218. string apiKey = 1;
  219. string apiEmail = 2;
  220. string zoneId = 3;
  221. }