syntax = "proto3";

package dubbo.mesh.v1alpha1;

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

import "api/mesh/options.proto";

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

  string configVersion = 1;
  // scope must be chosen from `service` and `application`
  string scope = 2;
  // key specifies which service or application the rule body acts on
  string key = 3;
  bool runtime = 4;
  bool enabled = 5;
  AffinityAware affinity = 6;
}

message AffinityAware {
  string key = 1;
  int32  ratio = 2;
}
