syntax = "proto3";

package envoy.config.filter.http.health_check.v2;

import "envoy/api/v2/route/route_components.proto";
import "envoy/type/percent.proto";

import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";

import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";

option java_package = "io.envoyproxy.envoy.config.filter.http.health_check.v2";
option java_outer_classname = "HealthCheckProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/filter/http/health_check/v2;health_checkv2";
option (udpa.annotations.file_migrate).move_to_package =
    "envoy.extensions.filters.http.health_check.v3";
option (udpa.annotations.file_status).package_version_status = FROZEN;

// [#protodoc-title: Health check]
// Health check :ref:`configuration overview <config_http_filters_health_check>`.
// [#extension: envoy.filters.http.health_check]

// [#next-free-field: 6]
message HealthCheck {
  reserved 2;

  // Specifies whether the filter operates in pass through mode or not.
  google.protobuf.BoolValue pass_through_mode = 1 [(validate.rules).message = {required: true}];

  // If operating in pass through mode, the amount of time in milliseconds
  // that the filter should cache the upstream response.
  google.protobuf.Duration cache_time = 3;

  // If operating in non-pass-through mode, specifies a set of upstream cluster
  // names and the minimum percentage of servers in each of those clusters that
  // must be healthy or degraded in order for the filter to return a 200.
  //
  // .. note::
  //
  //    This value is interpreted as an integer by truncating, so 12.50% will be calculated
  //    as if it were 12%.
  map<string, type.Percent> cluster_min_healthy_percentages = 4;

  // Specifies a set of health check request headers to match on. The health check filter will
  // check a request’s headers against all the specified headers. To specify the health check
  // endpoint, set the ``:path`` header to match on.
  repeated api.v2.route.HeaderMatcher headers = 5;
}
