123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- syntax = "proto3";
- package cloudflareApi.zone;
- option go_package = "./cloudflareApi/zone";
- option java_multiple_files = true;
- option java_package = "io.grpc.cloudflare.zone";
- option java_outer_classname = "zoneProto";
- service ZoneCloudflare {
- //Zone CURD
- rpc ZoneIDByNameCloudflare (ZoneIDByNameRequestCloudflare) returns (ZoneIDByNameReplyCloudflare) {}
- rpc ZoneDetails (ZoneDetailsRequestCloudflare) returns (ZoneDetailsReplyCloudflare){}
- rpc GetZones (GetZonesRequestCloudflare) returns (GetZonesReplyCloudflare){}
- rpc EditZone (EditZoneRequestCloudflare) returns (EditZoneReplyCloudflare){}
- rpc DeleteZone (DeleteZoneRequestCloudflare) returns (DeleteZoneReplyCloudflare){}
- rpc ListZones(ListZonesRequestCloudflare) returns (ZonesList){}
- rpc ListZonesByAccountId(ListZonesByAccountIdRequestCloudflare) returns (ZonesList){}
- rpc ActivationCheck(ActivationCheckRequestCloudflare) returns (ActivationCheckReplyCloudflare){}
- rpc CreateZone (CreateZoneRequestCloudflare) returns (CreateZoneReplyCloudflare){}
- rpc SetZonePlan (SetZonePlanRequestCloudflare)returns (SetZonePlanReplyCloudflare){}
- //PageRule CURD
- rpc ListPageRule(ListPageRuleRequestCloudflare) returns (PageRuleList){}
- rpc CreatePageRule(CreatePageRuleRequestCloudflare) returns (PageRule){}
- rpc UpdatePageRule(UpdatePageRuleRequestCloudflare) returns (PageRule){}
- rpc DeletePageRule(DeletePageRuleRequestCloudflare) returns (PageRule){}
- rpc UpdatePageRulesPriorities(UpdatePageRulesPrioritiesRequestCloudflare) returns(PageRuleList){}
- //RuleSet UR
- rpc UpdateRuleSet(UpdateRuleSetRequestCloudflare) returns (RuleList){}
- rpc GetRuleSet(GetRuleSetRequestCloudflare) returns (RuleList){}
- rpc ListZoneRuleSets(ListZoneRuleSetsRequestCloudflare)returns(RuleSetList){}
- rpc CreateZoneRuleSet(CreateZoneRuleSetRequestCloudflare)returns(CreateZoneRuleSetReplyCloudflare){}
- rpc DeleteZoneRuleSet(DeleteZoneRuleSetRequestCloudflare)returns(DeleteZoneRuleSetReplyCloudflare){}
- //Argo Smart Routing Setting UR
- rpc UpdateArgoSetting(UpdateArgoRequestCloudflare) returns(ArgoSetting){}
- rpc GetArgoSetting(IdRequest) returns(ArgoSetting){}
- rpc GetArgoSettingSubscription(IdRequest)returns(ArgoSetting){}
- rpc CreateArgoSettingSubscription(IdRequest)returns(ArgoSetting){}
- rpc SetSmartTieredCache(SetSmartTieredCacheRequestCloudflare)returns(SetSmartTieredCacheReplyCloudflare){}
- rpc UpdateAlwaysUseHttps(UpdateAlwaysUseHttpsRequestCloudflare)returns(UpdateAlwaysUseHttpsReplyCloudflare){}
- }
- //Zone CURD
- message ZoneCloudflareEntity{
- string id = 1;
- string name = 2;
- Plan plan = 3;
- Plan plan_pending = 4;
- string status = 5;
- bool paused = 6;
- string type = 7;
- string verification_key = 8;
- message Plan {
- string id = 1;
- string name = 2;
- sint64 price = 3;
- }
- }
- //
- message ZoneIDByNameRequestCloudflare {
- string apiKey = 1;
- string apiEmail = 2;
- string zoneName = 3;
- }
- message ZoneIDByNameReplyCloudflare {
- string zoneId = 1;
- }
- message ZoneDetailsRequestCloudflare {
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- }
- message ZoneDetailsReplyCloudflare{
- ZoneCloudflareEntity result = 1;
- }
- message GetZonesRequestCloudflare {
- string apiKey = 1;
- string apiEmail = 2;
- string domain = 3;
- }
- message GetZonesReplyCloudflare{
- repeated ZoneCloudflareEntity result = 1;
- bool success = 2;
- }
- message ListZonesRequestCloudflare {
- string apiKey = 1;
- string apiEmail = 2;
- }
- message ListZonesByAccountIdRequestCloudflare {
- string apiKey = 1;
- string apiEmail = 2;
- string accountId = 3;
- }
- message ZonesList{
- repeated ZoneCloudflareEntity result = 1;
- }
- message EditZoneRequestCloudflare {
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- optional bool paused = 4;
- optional string planId = 5;
- optional string type = 6;
- }
- message EditZoneReplyCloudflare{
- ZoneCloudflareEntity result = 1;
- bool success = 2;
- }
- message DeleteZoneRequestCloudflare {
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- }
- message DeleteZoneReplyCloudflare{
- bool success = 1;
- string id = 2;
- }
- message CreateZoneRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string accountId = 3;
- string domain = 4;
- }
- message CreateZoneReplyCloudflare{
- bool success = 1;
- string id = 2;
- }
- message SetZonePlanRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- string zonePlan = 4;
- }
- message SetZonePlanReplyCloudflare{
- bool success = 1;
- }
- message ActivationCheckRequestCloudflare {
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- }
- message ActivationCheckReplyCloudflare{
- bool success = 1;
- }
- //PageRule CRUD
- message PageRule{
- optional string id = 1;
- string expression = 2;
- optional uint32 ttl = 3;
- optional string queryArgsType = 4;
- repeated string queryArgs = 5;
- optional string originHost = 6;
- optional uint32 originProtocol = 7;
- // int64 priority = 8;
- }
- message PageRuleList{
- repeated PageRule page_rules = 1;
- }
- message ListPageRuleRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- }
- message CreatePageRuleRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- PageRule page_rule = 4;
- }
- message UpdatePageRuleRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- PageRule page_rule = 4;
- }
- message DeletePageRuleRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- string page_rule_id = 4;
- }
- //RuleSet UR
- enum Phase{
- http_request_sanitize = 0; //URL 规范化
- http_request_transform = 1; //URL 重写规则
- http_request_origin = 2; //起源规则
- http_request_cache_settings = 3; //缓存规则
- http_config_settings = 4; //配置规则
- // http_request_dynamic_redirect = 5; //动态重定向
- // ddos_l7 = 6; //HTTP DDoS 攻击防护
- // http_request_firewall_custom = 7; //Web 应用程序防火墙 (WAF)
- // http_ratelimit = 8; //限速规则
- // http_request_firewall_managed = 9; //Web 应用程序防火墙 (WAF)
- // http_request_sbfm = 10; //超级机器人战斗模式
- // http_request_redirect = 11; //批量重定向
- http_request_late_transform = 12; //HTTP 请求头修改规则
- // http_custom_errors = 13; //自定义错误响应
- http_response_headers_transform = 14; //HTTP响应头修改规则
- // http_response_firewall_managed = 15; //Cloudflare 敏感数据检测(数据丢失防护)
- // http_log_custom_fields = 16; //日志推送自定义字段
- }
- message Rule{
- string expression = 1;
- optional uint32 ttl = 2;
- optional string queryArgsType = 3;
- repeated string queryArgs = 4;
- optional string originHost = 5;
- optional string originPath = 6;
- optional uint32 originProtocol = 7;
- map<string, string> requestHeader = 8;
- map<string, string> responseHeader = 9;
- optional string id = 10;
- }
- message RuleList{
- repeated Rule rules = 1;
- }
- message RuleSet{
- optional string id = 1;
- string name = 2;
- string kind = 3;
- Phase phase = 4;
- }
- message ListZoneRuleSetsRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- }
- message DeleteZoneRuleSetRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- string ruleSetId = 4;
- }
- message DeleteZoneRuleSetReplyCloudflare{
- bool success = 1;
- }
- message RuleSetList {
- repeated RuleSet ruleSets = 1;
- }
- message GetRuleSetRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- Phase phase = 4;
- }
- message UpdateRuleSetRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- Phase phase = 4;
- repeated Rule rules = 5;
- }
- message UpdateRuleSetByRuleSetIdRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- string ruleSetId = 4;
- Phase phase = 5;
- repeated Rule rules = 6;
- }
- message CreateZoneRuleSetRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- RuleSet ruleSet = 4;
- repeated Rule rules = 5;
- }
- message CreateZoneRuleSetReplyCloudflare{
- bool success = 1;
- }
- message UpdatePageRulesPrioritiesStruct{
- string id = 1;
- int64 priority = 2;
- }
- message UpdatePageRulesPrioritiesRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- repeated UpdatePageRulesPrioritiesStruct data = 4;
- }
- message ArgoSetting{
- bool enabled = 1;
- }
- message UpdateArgoRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- ArgoSetting argo_setting = 4;
- }
- message IdRequest{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- }
- message SetSmartTieredCacheRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- }
- message SetSmartTieredCacheReplyCloudflare{
- bool enabled = 1;
- }
- message UpdateAlwaysUseHttpsRequestCloudflare{
- string apiKey = 1;
- string apiEmail = 2;
- string zoneId = 3;
- bool enabled = 4;
- }
- message UpdateAlwaysUseHttpsReplyCloudflare{
- bool success = 1;
- }
|