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){} //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){} } //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 requestHeader = 8; map responseHeader = 9; } message RuleList{ repeated Rule rules = 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 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; }