zone.proto 8.8 KB

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