zone.proto 7.3 KB

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