zone.proto 7.2 KB

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