You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/proto-public/pbmesh/v1alpha1/computed_routes.proto

119 lines
3.6 KiB

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
syntax = "proto3";
package hashicorp.consul.mesh.v1alpha1;
import "pbcatalog/v1alpha1/failover_policy.proto";
import "pbcatalog/v1alpha1/service.proto";
import "pbmesh/v1alpha1/common.proto";
import "pbmesh/v1alpha1/destination_policy.proto";
import "pbmesh/v1alpha1/grpc_route.proto";
import "pbmesh/v1alpha1/http_route.proto";
import "pbmesh/v1alpha1/http_route_retries.proto";
import "pbmesh/v1alpha1/http_route_timeouts.proto";
// This is a Resource type.
message ComputedRoutes {
map<string, ComputedPortRoutes> ported_configs = 1;
}
message ComputedPortRoutes {
oneof config {
ComputedHTTPRoute http = 1;
ComputedGRPCRoute grpc = 2;
ComputedTCPRoute tcp = 3;
}
bool using_default_config = 4; // TODO
// map key is an opaque string; like disco chain target name
map<string, BackendTargetDetails> targets = 5;
}
message ComputedHTTPRoute {
ParentReference parent_ref = 1;
reserved 2; // hostnames
repeated ComputedHTTPRouteRule rules = 3;
}
message ComputedHTTPRouteRule {
repeated HTTPRouteMatch matches = 1;
repeated HTTPRouteFilter filters = 2;
repeated ComputedHTTPBackendRef backend_refs = 3;
HTTPRouteTimeouts timeouts = 4;
HTTPRouteRetries retries = 5;
}
message ComputedHTTPBackendRef {
// BackendTarget indicates which key in the targets map provides
// the rest of the configuration.
//
// If this field is set to the empty string, or is the sentinel value
// "NULL-ROUTE" is an indication that all of the traffic destined for this
// backend reference should be null routed in a format appropriate for the
// protocol (i.e. for HTTP use 5xx).
string backend_target = 1;
uint32 weight = 2;
repeated HTTPRouteFilter filters = 3;
}
message ComputedGRPCRoute {
ParentReference parent_ref = 1;
reserved 2; // hostnames
repeated ComputedGRPCRouteRule rules = 3;
}
message ComputedGRPCRouteRule {
repeated GRPCRouteMatch matches = 1;
repeated GRPCRouteFilter filters = 2;
repeated ComputedGRPCBackendRef backend_refs = 3;
HTTPRouteTimeouts timeouts = 4;
HTTPRouteRetries retries = 5;
}
message ComputedGRPCBackendRef {
// BackendTarget indicates which key in the targets map provides
// the rest of the configuration.
//
// If this field is set to the empty string, or is the sentinel value
// "NULL-ROUTE" is an indication that all of the traffic destined for this
// backend reference should be null routed in a format appropriate for the
// protocol (i.e. for HTTP use 5xx).
string backend_target = 1;
uint32 weight = 2;
repeated GRPCRouteFilter filters = 3;
}
message ComputedTCPRoute {
ParentReference parent_ref = 1;
repeated ComputedTCPRouteRule rules = 2;
}
message ComputedTCPRouteRule {
repeated ComputedTCPBackendRef backend_refs = 1;
}
// TODO: look into smuggling the target through a different typeURL, or just
// skip in favor of letting the caller do their own lookups?
message ComputedTCPBackendRef {
// BackendTarget indicates which key in the targets map provides
// the rest of the configuration.
//
// If this field is set to the empty string, or is the sentinel value
// "NULL-ROUTE" is an indication that all of the traffic destined for this
// backend reference should be null routed in a format appropriate for the
// protocol (i.e. for HTTP use 5xx).
string backend_target = 1;
uint32 weight = 2;
}
message BackendTargetDetails {
// identity info
BackendReference backend_ref = 1;
hashicorp.consul.catalog.v1alpha1.Service service = 3;
hashicorp.consul.catalog.v1alpha1.FailoverPolicy failover_policy = 4;
DestinationPolicy destination_policy = 5;
}