syntax = "proto3";

package dubbo.mesh.v1alpha1;

option go_package = "github.com/apache/dubbo-admin/api/mesh/v1alpha1";

import "api/mesh/options.proto";

message ConditionRoute {
  option (dubbo.mesh.resource).name = "ConditionRoute";
  option (dubbo.mesh.resource).plural_name = "ConditionRoutes";
  option (dubbo.mesh.resource).package = "mesh";
  option (dubbo.mesh.resource).is_experimental = false;

    string configVersion = 1;
    int32 priority = 2;
    bool enabled = 3;
    bool force = 4;
    bool runtime = 5;
    string key = 6;
    string scope = 7;
    repeated string conditions = 8;
}

message ConditionRule {
  ConditionRuleFrom from = 1;
  repeated ConditionRuleTo to = 2;
}

message ConditionRuleFrom {
  string match = 1;
}

message ConditionRuleTo {
  string match = 1;
  int32 weight = 2; // default value will be handled by application logic
}