diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cdb6235..c17e99e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -49,7 +49,7 @@ jobs: CGO_ENABLED: 0 - name: Test - run: go test -race ./... + run: make test - name: Set up QEMU uses: docker/setup-qemu-action@v2 diff --git a/.github/workflows/fossa.yaml b/.github/workflows/fossa.yaml new file mode 100644 index 0000000..67784d8 --- /dev/null +++ b/.github/workflows/fossa.yaml @@ -0,0 +1,13 @@ +name: FOSSA +on: + push: + branches: + - main +jobs: + fossa-scan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: fossas/fossa-action@v1 + with: + api-key: ${{ secrets.FOSSA_API_KEY }} diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml new file mode 100644 index 0000000..03d6ba1 --- /dev/null +++ b/.github/workflows/golangci-lint.yaml @@ -0,0 +1,18 @@ +name: golangci-lint +on: + pull_request: +permissions: + contents: read +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: stable + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + args: --timeout=5m diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..6bbe94f --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,93 @@ +linters: + disable-all: true + enable: + - containedctx + - dogsled + - dupword + - durationcheck + - errcheck + - errname + - errorlint + - gci + - gocognit + - goconst + - gocritic + - godot + - gofmt + - gofumpt + - goprintffuncname + - gosec + - gosimple + - govet + - ineffassign + - lll + - misspell + - nakedret + - paralleltest + - revive + - sqlclosecheck + - staticcheck + - stylecheck + - typecheck + - unconvert + - unparam + - unused + - whitespace + +linters-settings: + gocritic: + enabled-all: true + disabled-checks: + - commentFormatting + godot: + scope: all + gofumpt: + module-path: cloud-proxy + extra-rules: true + goconst: + min-len: 2 + min-occurrences: 5 + golint: + min-confidence: 0 + gomnd: + settings: + mnd: + # don't include the "operation" and "assign" + checks: [argument,case,condition,return] + govet: + # shadow is marked as experimental feature, skip it for now. + check-shadowing: false + settings: + printf: + funcs: + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf + lll: + line-length: 200 + maligned: + suggest-new: true + misspell: + locale: US + revive: + rules: + - name: redefines-builtin-id + disabled: true + + # Allow code like: + # Items: binpacking.Items{ + # { + # }, + # } + - name: nested-structs + disabled: true + gci: + sections: + - standard + - default + - prefix(cloud-proxy) +issues: + exclude-dirs: + - mock + - internal/castai diff --git a/Makefile b/Makefile index 5f706cf..f09a87c 100644 --- a/Makefile +++ b/Makefile @@ -29,3 +29,14 @@ generate-grpc: --go-grpc_out=proto/gen --go-grpc_opt paths=source_relative .PHONY: generate-grpc +lint: + golangci-lint run ./... +.PHONY: lint + +fix: + golangci-lint run --fix ./... +.PHONY: fix + +test: + go test ./... -race +.PHONY: test \ No newline at end of file diff --git a/cmd/proxy/main.go b/cmd/proxy/main.go index 678105a..720a548 100644 --- a/cmd/proxy/main.go +++ b/cmd/proxy/main.go @@ -8,18 +8,18 @@ import ( "runtime" "time" - "cloud-proxy/internal/cloud/gcp" - "cloud-proxy/internal/cloud/gcp/gcpauth" - "cloud-proxy/internal/config" - "cloud-proxy/internal/healthz" - "cloud-proxy/internal/proxy" - "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/backoff" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/metadata" + + "cloud-proxy/internal/cloud/gcp" + "cloud-proxy/internal/cloud/gcp/gcpauth" + "cloud-proxy/internal/config" + "cloud-proxy/internal/healthz" + "cloud-proxy/internal/proxy" ) var ( @@ -35,7 +35,7 @@ func main() { dialOpts := make([]grpc.DialOption, 0) if cfg.CastAI.DisableGRPCTLS { - // ONLY For testing purposes + // ONLY For testing purposes. dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials())) } else { dialOpts = append(dialOpts, grpc.WithTransportCredentials(credentials.NewTLS(nil))) @@ -73,14 +73,13 @@ func main() { }(conn) ctx := metadata.NewOutgoingContext(context.Background(), metadata.Pairs( - "authorization", fmt.Sprintf("Token %s", cfg.CastAI.ApiKey), + "authorization", fmt.Sprintf("Token %s", cfg.CastAI.APIKey), )) - client := proxy.New(conn, gcp.New(gcpauth.NewCredentialsSource(), http.DefaultClient), logger, - cfg.ClusterID, GetVersion(), cfg.KeepAlive, cfg.KeepAliveTimeout) - go startHealthServer(logger, cfg.HealthAddress) + client := proxy.New(conn, gcp.New(gcpauth.NewCredentialsSource(), http.DefaultClient), logger, + cfg.GetPodName(), cfg.ClusterID, GetVersion(), cfg.KeepAlive, cfg.KeepAliveTimeout) err = client.Run(ctx) if err != nil { logger.Panicf("Failed to run client: %v", err) @@ -97,7 +96,7 @@ func setupLogger(cfg config.Config) *logrus.Logger { logger.SetLevel(logrus.Level(cfg.Log.Level)) logger.SetReportCaller(true) logger.Formatter = &logrus.TextFormatter{ - CallerPrettyfier: func(f *runtime.Frame) (function string, file string) { + CallerPrettyfier: func(f *runtime.Frame) (function, file string) { filename := path.Base(f.File) return fmt.Sprintf("%s()", f.Function), fmt.Sprintf("%s:%d", filename, f.Line) }, diff --git a/e2e/Dockerfile b/e2e/Dockerfile deleted file mode 100644 index fa98e3e..0000000 --- a/e2e/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM gcr.io/distroless/static-debian11 -COPY bin/cloud-proxy-e2e /usr/local/bin/cloud-proxy-e2e -CMD ["cloud-proxy-e2e"] - diff --git a/e2e/chart/.helmignore b/e2e/chart/.helmignore deleted file mode 100644 index 0e8a0eb..0000000 --- a/e2e/chart/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/e2e/chart/Chart.yaml b/e2e/chart/Chart.yaml deleted file mode 100644 index 973b09a..0000000 --- a/e2e/chart/Chart.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: v2 -name: cloud-proxy-e2e -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" diff --git a/e2e/chart/templates/_helpers.tpl b/e2e/chart/templates/_helpers.tpl deleted file mode 100644 index 60d16d1..0000000 --- a/e2e/chart/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "e2e.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "e2e.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "e2e.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "e2e.labels" -}} -helm.sh/chart: {{ include "e2e.chart" . }} -{{ include "e2e.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "e2e.selectorLabels" -}} -app.kubernetes.io/name: {{ include "e2e.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "e2e.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "e2e.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/e2e/chart/templates/job.yaml b/e2e/chart/templates/job.yaml deleted file mode 100644 index 54abbbf..0000000 --- a/e2e/chart/templates/job.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ include "e2e.fullname" . }} - labels: - {{- include "e2e.labels" . | nindent 4}} -spec: - backoffLimit: 0 - template: - metadata: - labels: - {{- include "e2e.selectorLabels" . | nindent 8 }} - spec: - restartPolicy: Never - containers: - - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - name: {{ .Chart.Name }} - ports: - - containerPort: 50051 - name: grpc - diff --git a/e2e/chart/templates/service.yaml b/e2e/chart/templates/service.yaml deleted file mode 100644 index dc82ef8..0000000 --- a/e2e/chart/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "e2e.fullname" . }} - labels: - {{- include "e2e.labels" . | nindent 4 }} -spec: - type: ClusterIP - ports: - - port: 50051 - targetPort: grpc - protocol: TCP - name: grpc - selector: - {{- include "e2e.selectorLabels" . | nindent 4 }} diff --git a/e2e/chart/values.yaml b/e2e/chart/values.yaml deleted file mode 100644 index beb389b..0000000 --- a/e2e/chart/values.yaml +++ /dev/null @@ -1,5 +0,0 @@ -image: - repository: cloud-proxy-e2e - pullPolicy: IfNotPresent - tag: "" - diff --git a/e2e/main.go b/e2e/main.go deleted file mode 100644 index b68aa9c..0000000 --- a/e2e/main.go +++ /dev/null @@ -1,61 +0,0 @@ -package main - -import ( - "context" - "fmt" - "log" - "net/http" - "os" - - "cloud.google.com/go/container/apiv1/containerpb" - "golang.org/x/sync/errgroup" -) - -const projectID = "engineering-test-353509" - -func TestParallelCalls(ctx context.Context, server Server, rt http.RoundTripper) error { - if err := server.StartServer(); err != nil { - return err - } - defer server.GracefulStopServer() - - eg := &errgroup.Group{} - for i := 0; i < 3; i++ { - eg.Go(func() error { - contClient, err := GetContainerClient(ctx, rt) - if err != nil { - return err - } - - _, err = contClient.ListClusters(ctx, &containerpb.ListClustersRequest{ - Parent: fmt.Sprintf("projects/%s/locations/-", projectID), - }) - if err != nil { - return err - } - - return nil - }) - } - return eg.Wait() -} - -func main() { - ctx := context.Background() - - logger := log.New(os.Stderr, "[CLOUD-PROXY-E2E] ", log.LstdFlags) - - setup := NewTestSetup(logger) - - tt := map[string]func(ctx context.Context, server Server, rt http.RoundTripper) error{ - "basic test": TestParallelCalls, - } - - for name, testFunc := range tt { - setup.ExecuteTest(ctx, name, testFunc) - } - - if !setup.result { - os.Exit(1) - } -} diff --git a/e2e/run.sh b/e2e/run.sh deleted file mode 100755 index 4e4892c..0000000 --- a/e2e/run.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env bash - -set -eEu - -CLUSTER_NAME=cloud-proxy-e2e -IMAGE_TAG=$RANDOM - -shout() { - echo "============= $(date) ===============" - echo "= $1" - echo "===========================================================" -} -kind::ensure() { - if ! kind export kubeconfig --name "${CLUSTER_NAME}"; then - kind create cluster --name "${CLUSTER_NAME}" - fi -} - -kind::load_images() { - kind load docker-image --name "${CLUSTER_NAME}" cloud-proxy:$IMAGE_TAG - kind load docker-image --name "${CLUSTER_NAME}" cloud-proxy-e2e:$IMAGE_TAG - -} - -cloud_proxy::build_image() { - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o bin/castai-cloud-proxy-amd64 ./cmd/proxy - docker build -t cloud-proxy:$IMAGE_TAG . -} - -cloud_proxy::helm_install() { - helm upgrade --install --wait \ - --set image.repository=cloud-proxy \ - --set image.tag=$IMAGE_TAG \ - --set config.grpc.endpoint=cloud-proxy-e2e:50051 \ - --set config.grpc.key=dummytoken \ - --set config.grpc.tls.enabled=false \ - --set-file config.gcpCredentials="${GCP_CREDENTIALS}" \ - castai-cloud-proxy ../github-helm-charts/charts/castai-cloud-proxy -} - -e2e::build_image() { - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o bin/cloud-proxy-e2e ./e2e - docker build -t cloud-proxy-e2e:$IMAGE_TAG -f ./e2e/Dockerfile . -} - -e2e::helm_install() { - helm upgrade --install --wait \ - --set image.tag=$IMAGE_TAG \ - cloud-proxy-e2e ./e2e/chart -} - -e2e::helm_uninstall() { - helm delete cloud-proxy-e2e -} - -e2e::failure() { - shout "e2e logs" - kubectl logs jobs/cloud-proxy-e2e - - shout "cloud-proxy logs" - kubectl logs deployment/castai-cloud-proxy -} - -main() { - [[ -z "${GCP_CREDENTIALS:-}" ]] && echo "Missing GCP_CREDENTIALS" && exit 1 - - kind::ensure - cloud_proxy::build_image - e2e::build_image - kind::load_images - cloud_proxy::helm_install - e2e::helm_install - - kubectl wait jobs cloud-proxy-e2e --for condition=Complete --timeout=120s & - local -r complete_pid="$!" - - kubectl wait jobs cloud-proxy-e2e --for condition=Failed --timeout=120s && exit 1 & - local -r failed_pid="$!" - - if wait -n "$complete_pid" "$failed_pid"; then - local -r exit_code=0 - shout "TESTS PASSED!" - else - local -r exit_code=1 - shout "TESTS FAILED!" - e2e::failure - fi - - e2e::helm_uninstall - - exit $exit_code -} - -main $@ diff --git a/e2e/setup.go b/e2e/setup.go deleted file mode 100644 index 1ac94de..0000000 --- a/e2e/setup.go +++ /dev/null @@ -1,163 +0,0 @@ -package main - -import ( - "context" - "fmt" - "io" - "log" - "net" - "net/http" - - "cloud-proxy/internal/e2etest" - cloudproxyv1alpha "cloud-proxy/proto/gen/proto/v1alpha" - compute "cloud.google.com/go/compute/apiv1" - container "cloud.google.com/go/container/apiv1" - "golang.org/x/sync/errgroup" - "google.golang.org/api/option" - "google.golang.org/grpc" -) - -type Server interface { - StartServer() error - StopServer() - GracefulStopServer() -} - -type TestSetup struct { - cloudproxyv1alpha.UnimplementedCloudProxyAPIServer - - result bool - - grpcServer *grpc.Server - dispatcher *e2etest.Dispatcher - roundTripper *e2etest.HttpOverGrpcRoundTripper - - requestChan chan *cloudproxyv1alpha.StreamCloudProxyResponse - responseChan chan *cloudproxyv1alpha.StreamCloudProxyRequest - - logger *log.Logger -} - -func NewTestSetup(logger *log.Logger) *TestSetup { - requestChan, respChan := make(chan *cloudproxyv1alpha.StreamCloudProxyResponse), make(chan *cloudproxyv1alpha.StreamCloudProxyRequest) - dispatcher := e2etest.NewDispatcher(requestChan, respChan, logger) - roundTrip := e2etest.NewHttpOverGrpcRoundTripper(dispatcher, logger) - - dispatcher.Run() - - return &TestSetup{ - result: true, - dispatcher: dispatcher, - roundTripper: roundTrip, - requestChan: requestChan, - responseChan: respChan, - logger: logger, - } -} - -func (srv *TestSetup) StartServer() error { - list, err := net.Listen("tcp", "0.0.0.0:50051") - if err != nil { - return fmt.Errorf("listening: %w", err) - } - - srv.grpcServer = grpc.NewServer() - cloudproxyv1alpha.RegisterCloudProxyAPIServer(srv.grpcServer, srv) - - go func() { - if err := srv.grpcServer.Serve(list); err != nil { - srv.logger.Printf("when serving grpc: %v", err) - } - }() - - return nil -} - -func (srv *TestSetup) StopServer() { - srv.grpcServer.Stop() -} - -func (srv *TestSetup) GracefulStopServer() { - srv.grpcServer.Stop() -} - -func (srv *TestSetup) StreamCloudProxy(stream cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyServer) error { - srv.logger.Println("Received a proxy connection from client") - - //md, ok := metadata.FromIncomingContext(stream.Context()) - //if !ok { - // return fmt.Errorf("missing metadata") - //} - //if token := md.Get("authorization"); token[0] != "Token dummytoken" { - // fmt.Println(token) - // return fmt.Errorf("wrong authentication token") - //} - - var eg errgroup.Group - - eg.Go(func() error { - srv.logger.Println("Starting request sender") - - for { - select { - case req := <-srv.requestChan: - srv.logger.Println("Sending request to cluster proxy client") - - if err := stream.Send(req); err != nil { - srv.logger.Printf("Error sending request: %v\n", err) - } - case <-stream.Context().Done(): - srv.logger.Printf("stream closed, stopping sending responses") - return nil - } - } - }) - - eg.Go(func() error { - srv.logger.Println("Starting response receiver") - - for { - in, err := stream.Recv() - if err == io.EOF { - fmt.Println("stream was closed by client") - return err - } - if err != nil { - srv.logger.Printf("Error in response receiver: %v\n", err) - return err - } - - srv.logger.Printf("Got a response from client: %v, %v\n", - in.GetResponse().GetMessageId(), in.GetResponse().GetHttpResponse().GetStatus()) - srv.responseChan <- in - } - }) - - return eg.Wait() -} - -func (srv *TestSetup) ExecuteTest(ctx context.Context, name string, f func(ctx context.Context, server Server, rt http.RoundTripper) error) { - if err := f(ctx, srv, srv.roundTripper); err != nil { - srv.logger.Printf("TEST FAILED: %s", name) - srv.logger.Printf("error: %v", err) - srv.result = false - } else { - srv.logger.Printf("TEST PASSED: %s", name) - } -} - -func GetContainerClient(ctx context.Context, rt http.RoundTripper) (*container.ClusterManagerClient, error) { - httpClient := &http.Client{} - httpClient.Transport = rt - return container.NewClusterManagerRESTClient(ctx, - option.WithoutAuthentication(), - option.WithHTTPClient(httpClient)) -} - -func GetZonesClient(ctx context.Context, rt http.RoundTripper) (*compute.ZonesClient, error) { - httpClient := &http.Client{} - httpClient.Transport = rt - return compute.NewZonesRESTClient(ctx, - option.WithoutAuthentication(), - option.WithHTTPClient(httpClient)) -} diff --git a/internal/castai/dummy/external_provisioner_mock.go b/internal/castai/dummy/external_provisioner_mock.go index 4ae1385..4f15190 100644 --- a/internal/castai/dummy/external_provisioner_mock.go +++ b/internal/castai/dummy/external_provisioner_mock.go @@ -7,11 +7,12 @@ import ( "math/rand/v2" "time" - "cloud-proxy/internal/e2etest" container "cloud.google.com/go/container/apiv1" "cloud.google.com/go/container/apiv1/containerpb" "google.golang.org/api/option" htransport "google.golang.org/api/transport/http" + + "cloud-proxy/internal/e2etest" ) const ( @@ -30,7 +31,7 @@ func newMockEP(dispatcher *e2etest.Dispatcher, logger *log.Logger) (*mockEP, err if err != nil { return nil, err } - httpClient.Transport = e2etest.NewHttpOverGrpcRoundTripper(dispatcher, logger) + httpClient.Transport = e2etest.NewHTTPOverGrpcRoundTripper(dispatcher, logger) gkeProxiedClient, err := container.NewClusterManagerRESTClient( context.Background(), option.WithoutAuthentication(), diff --git a/internal/cloud/gcp/executor.go b/internal/cloud/gcp/executor.go index e54b221..be8c1d5 100644 --- a/internal/cloud/gcp/executor.go +++ b/internal/cloud/gcp/executor.go @@ -2,9 +2,10 @@ package gcp import ( - "cloud-proxy/internal/cloud/gcp/gcpauth" "fmt" "net/http" + + "cloud-proxy/internal/cloud/gcp/gcpauth" ) type Credentials interface { @@ -26,14 +27,14 @@ func (c *Client) DoHTTPRequest(request *http.Request) (*http.Response, error) { token, err := c.credentials.GetToken() if err != nil { - return nil, fmt.Errorf("credentialsSrc.GetToken: error: %v", err) + return nil, fmt.Errorf("credentialsSrc.GetToken: error: %w", err) } - // Set the authorize header manually since we can't rely on mothership auth + // Set the authorize header manually since we can't rely on mothership auth. request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) resp, err := c.httpClient.Do(request) if err != nil { - return nil, fmt.Errorf("httpClient.Do: request %+v error: %v", request, err) + return nil, fmt.Errorf("httpClient.Do: request %+v error: %w", request, err) } return resp, nil diff --git a/internal/cloud/gcp/gcpauth/client.go b/internal/cloud/gcp/gcpauth/client.go index 2fb164a..54c5fc8 100644 --- a/internal/cloud/gcp/gcpauth/client.go +++ b/internal/cloud/gcp/gcpauth/client.go @@ -20,7 +20,7 @@ type CredentialsSource struct { scopes []string } -// TODO: check if we should be doing it constantly; cache them; cache the token or something else +// TODO: check if we should be doing it constantly; cache them; cache the token or something else. func (src *CredentialsSource) getDefaultCredentials() (*google.Credentials, error) { defaultCreds, err := google.FindDefaultCredentials(context.Background(), src.scopes...) @@ -29,6 +29,7 @@ func (src *CredentialsSource) getDefaultCredentials() (*google.Credentials, erro } return defaultCreds, nil } + func (src *CredentialsSource) GetToken() (string, error) { credentials, err := src.getDefaultCredentials() if err != nil { diff --git a/internal/config/config.go b/internal/config/config.go index ee6b306..17113a4 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -22,7 +22,7 @@ type Config struct { PodMetadata PodMetadata `mapstructure:"podmetadata"` - //MetricsAddress string `mapstructure:"metricsaddress"` + // MetricsAddress string `mapstructure:"metricsaddress"`. HealthAddress string `mapstructure:"healthaddress"` Log Log `mapstructure:"log"` } @@ -41,8 +41,8 @@ type PodMetadata struct { // CastAPI contains the configuration for the connection to CAST AI API. type CastAPI struct { - // ApiKey is the API key used to authenticate to CAST AI API. - ApiKey string `mapstructure:"apikey"` + // APIKey is the API key used to authenticate to CAST AI API. + APIKey string `mapstructure:"apikey"` // URL is the URL of CAST AI REST API. URL string `mapstructure:"url"` // GrpcURL is the URL of CAST AI gRPC API. @@ -57,7 +57,7 @@ type GCP struct { } type Log struct { - Level int `mapstructure:"level"` + Level uint32 `mapstructure:"level"` } var cfg *Config = nil @@ -93,7 +93,7 @@ func Get() Config { panic(fmt.Errorf("while parsing config: %w", err)) } - if cfg.CastAI.ApiKey == "" { + if cfg.CastAI.APIKey == "" { required("CAST_API_KEY") } if cfg.CastAI.GrpcURL == "" { @@ -107,7 +107,7 @@ func Get() Config { } if cfg.Log.Level == 0 { - cfg.Log.Level = int(logrus.InfoLevel) + cfg.Log.Level = uint32(logrus.InfoLevel) } if cfg.KeepAlive == 0 { @@ -131,3 +131,7 @@ func Get() Config { func required(variable string) { panic(fmt.Errorf("variable %s is required", variable)) } + +func (c *Config) GetPodName() string { + return fmt.Sprintf("%v@%v", cfg.PodMetadata.PodNamespace, cfg.PodMetadata.PodName) +} diff --git a/internal/config/config_test.go b/internal/config/config_test.go index d58bcf7..37a8c40 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" ) -// TODO: test defaults +// TODO: test defaults. func TestConfig(t *testing.T) { r := require.New(t) @@ -30,7 +30,7 @@ func TestConfig(t *testing.T) { expected := Config{ CastAI: CastAPI{ - ApiKey: "API_KEY", + APIKey: "API_KEY", URL: "cast-url", GrpcURL: "cast-grpc-url", DisableGRPCTLS: true, diff --git a/internal/e2etest/roundtripper.go b/internal/e2etest/roundtripper.go index 80c041b..40d2736 100644 --- a/internal/e2etest/roundtripper.go +++ b/internal/e2etest/roundtripper.go @@ -7,22 +7,22 @@ import ( "log" "net/http" - cloudproxyv1alpha "cloud-proxy/proto/gen/proto/v1alpha" - "github.com/google/uuid" + + cloudproxyv1alpha "cloud-proxy/proto/gen/proto/v1alpha" ) -type HttpOverGrpcRoundTripper struct { +type HTTPOverGrpcRoundTripper struct { dispatcher *Dispatcher logger *log.Logger } -func NewHttpOverGrpcRoundTripper(dispatcher *Dispatcher, logger *log.Logger) *HttpOverGrpcRoundTripper { - return &HttpOverGrpcRoundTripper{dispatcher: dispatcher, logger: logger} +func NewHTTPOverGrpcRoundTripper(dispatcher *Dispatcher, logger *log.Logger) *HTTPOverGrpcRoundTripper { + return &HTTPOverGrpcRoundTripper{dispatcher: dispatcher, logger: logger} } -func (p *HttpOverGrpcRoundTripper) RoundTrip(request *http.Request) (*http.Response, error) { +func (p *HTTPOverGrpcRoundTripper) RoundTrip(request *http.Request) (*http.Response, error) { requestID := uuid.New().String() headers := make(map[string]*cloudproxyv1alpha.HeaderValue) @@ -50,13 +50,13 @@ func (p *HttpOverGrpcRoundTripper) RoundTrip(request *http.Request) (*http.Respo } waiter, err := p.dispatcher.SendRequest(protoReq) if err != nil { - return nil, fmt.Errorf("error sending request: %v", err) + return nil, fmt.Errorf("error sending request: %w", err) } response := <-waiter p.logger.Println("Received a response back from dispatcher", requestID) - // Convert to response + // Convert to response. resp := &http.Response{ StatusCode: int(response.GetResponse().GetHttpResponse().GetStatus()), Header: func() http.Header { diff --git a/internal/healthz/healthz.go b/internal/healthz/healthz.go index 641c115..30fddb3 100644 --- a/internal/healthz/healthz.go +++ b/internal/healthz/healthz.go @@ -3,6 +3,7 @@ package healthz import ( "encoding/json" "net/http" + "time" "github.com/sirupsen/logrus" ) @@ -23,10 +24,16 @@ func (hc *Server) Run(addr string) error { mux.HandleFunc("/readyz", hc.readyCheck) mux.HandleFunc("/livez", hc.liveCheck) - return http.ListenAndServe(addr, mux) + server := &http.Server{ + Addr: addr, + ReadHeaderTimeout: 3 * time.Second, + Handler: mux, + } + + return server.ListenAndServe() } -func (hc *Server) readyCheck(w http.ResponseWriter, r *http.Request) { +func (hc *Server) readyCheck(w http.ResponseWriter, _ *http.Request) { w.Header().Set("content-type", "application/json") // TODO: Implement proper readiness checks. @@ -49,7 +56,7 @@ func (hc *Server) readyCheck(w http.ResponseWriter, r *http.Request) { } } -func (hc *Server) liveCheck(w http.ResponseWriter, r *http.Request) { +func (hc *Server) liveCheck(w http.ResponseWriter, _ *http.Request) { w.Header().Set("content-type", "application/json") // TODO: Implement proper liveness checks. diff --git a/internal/proxy/client.go b/internal/proxy/client.go index 20a0098..0c561ed 100644 --- a/internal/proxy/client.go +++ b/internal/proxy/client.go @@ -31,6 +31,7 @@ type Client struct { grpcConn *grpc.ClientConn cloudClient CloudClient log *logrus.Logger + podName string clusterID string errCount atomic.Int64 @@ -43,11 +44,12 @@ type Client struct { version string } -func New(grpcConn *grpc.ClientConn, cloudClient CloudClient, logger *logrus.Logger, clusterID, version string, keepalive, keepaliveTimeout time.Duration) *Client { +func New(grpcConn *grpc.ClientConn, cloudClient CloudClient, logger *logrus.Logger, podName, clusterID, version string, keepalive, keepaliveTimeout time.Duration) *Client { c := &Client{ grpcConn: grpcConn, cloudClient: cloudClient, log: logger, + podName: podName, clusterID: clusterID, version: version, } @@ -106,6 +108,7 @@ func (c *Client) sendInitialRequest(stream cloudproxyv1alpha.CloudProxyAPI_Strea Request: &cloudproxyv1alpha.StreamCloudProxyRequest_InitialRequest{ InitialRequest: &cloudproxyv1alpha.InitialCloudProxyRequest{ ClientMetadata: &cloudproxyv1alpha.ClientMetadata{ + PodName: c.podName, ClusterId: c.clusterID, }, Version: c.version, @@ -170,7 +173,7 @@ func (c *Client) run(ctx context.Context, stream cloudproxyv1alpha.CloudProxyAPI case <-time.After(time.Duration(c.keepAlive.Load())): if !c.isAlive() { if err := c.lastSeenError.Load(); err != nil { - return fmt.Errorf("recived error: %w", *err) + return fmt.Errorf("received error: %w", *err) } return fmt.Errorf("last seen too old, closing stream") } @@ -185,7 +188,7 @@ func (c *Client) handleMessage(in *cloudproxyv1alpha.StreamCloudProxyResponse, s } c.processConfigurationRequest(in) - // skip processing http request if keep alive message + // skip processing http request if keep alive message. if in.GetMessageId() == KeepAliveMessageID { c.lastSeen.Store(time.Now().UnixNano()) c.log.Debugf("Received keep-alive message from castai for %s", in.GetClientMetadata().GetClusterId()) @@ -193,7 +196,7 @@ func (c *Client) handleMessage(in *cloudproxyv1alpha.StreamCloudProxyResponse, s } c.log.Debugf("Received request for proxying msg_id=%v from castai", in.GetMessageId()) - resp := c.processHttpRequest(in.GetHttpRequest()) + resp := c.processHTTPRequest(in.GetHttpRequest()) if resp.GetError() != "" { c.log.Errorf("Failed to proxy request msg_id=%v with %v", in.GetMessageId(), resp.GetError()) } else { @@ -203,6 +206,7 @@ func (c *Client) handleMessage(in *cloudproxyv1alpha.StreamCloudProxyResponse, s Request: &cloudproxyv1alpha.StreamCloudProxyRequest_Response{ Response: &cloudproxyv1alpha.ClusterResponse{ ClientMetadata: &cloudproxyv1alpha.ClientMetadata{ + PodName: c.podName, ClusterId: c.clusterID, }, MessageId: in.GetMessageId(), @@ -218,15 +222,15 @@ func (c *Client) handleMessage(in *cloudproxyv1alpha.StreamCloudProxyResponse, s func (c *Client) processConfigurationRequest(in *cloudproxyv1alpha.StreamCloudProxyResponse) { if in.ConfigurationRequest != nil { if in.ConfigurationRequest.GetKeepAlive() != 0 { - c.keepAlive.Store(int64(in.ConfigurationRequest.GetKeepAlive())) + c.keepAlive.Store(in.ConfigurationRequest.GetKeepAlive()) } if in.ConfigurationRequest.GetKeepAliveTimeout() != 0 { - c.keepAliveTimeout.Store(int64(in.ConfigurationRequest.GetKeepAliveTimeout())) + c.keepAliveTimeout.Store(in.ConfigurationRequest.GetKeepAliveTimeout()) } } } -func (c *Client) processHttpRequest(req *cloudproxyv1alpha.HTTPRequest) *cloudproxyv1alpha.HTTPResponse { +func (c *Client) processHTTPRequest(req *cloudproxyv1alpha.HTTPRequest) *cloudproxyv1alpha.HTTPResponse { if req == nil { return &cloudproxyv1alpha.HTTPResponse{ Error: lo.ToPtr("nil http request"), @@ -252,6 +256,7 @@ func (c *Client) processHttpRequest(req *cloudproxyv1alpha.HTTPRequest) *cloudpr func (c *Client) isAlive() bool { lastSeen := c.lastSeen.Load() + return time.Now().UnixNano()-lastSeen <= c.keepAliveTimeout.Load() } @@ -275,9 +280,12 @@ func (c *Client) sendKeepAlive(stream cloudproxyv1alpha.CloudProxyAPI_StreamClou Request: &cloudproxyv1alpha.StreamCloudProxyRequest_ClientStats{ ClientStats: &cloudproxyv1alpha.ClientStats{ ClientMetadata: &cloudproxyv1alpha.ClientMetadata{ + PodName: c.podName, ClusterId: c.clusterID, }, - Status: cloudproxyv1alpha.ClientStats_OK, + Stats: &cloudproxyv1alpha.ClientStats_Stats{ + Status: cloudproxyv1alpha.ClientStats_Stats_OK, + }, }, }, }) @@ -300,7 +308,7 @@ func (c *Client) toHTTPRequest(req *cloudproxyv1alpha.HTTPRequest) (*http.Reques reqHTTP, err := http.NewRequestWithContext(context.Background(), req.GetMethod(), req.GetPath(), bytes.NewReader(req.GetBody())) if err != nil { - return nil, fmt.Errorf("http.NewRequest: error: %v", err) + return nil, fmt.Errorf("http.NewRequest: error: %w", err) } for header, values := range req.GetHeaders() { @@ -339,7 +347,7 @@ func (c *Client) toResponse(resp *http.Response) *cloudproxyv1alpha.HTTPResponse return &cloudproxyv1alpha.HTTPResponse{ Body: bodyResp, Error: errMessage, - Status: int32(resp.StatusCode), + Status: int64(resp.StatusCode), Headers: headers, } } diff --git a/internal/proxy/client_test.go b/internal/proxy/client_test.go index 0a1c446..c98cd09 100644 --- a/internal/proxy/client_test.go +++ b/internal/proxy/client_test.go @@ -1,3 +1,4 @@ +// nolint: gocritic package proxy import ( @@ -31,8 +32,8 @@ func (m mockReadCloserErr) Close() error { return nil } func TestClient_toResponse(t *testing.T) { t.Parallel() type fields struct { - //tuneMockCredentials func(m *mock_gcp.MockCredentials) - //httpClient *http.Client + // tuneMockCredentials func(m *mock_gcp.MockCredentials) + // httpClient *http.Client. } type args struct { msgID string @@ -82,10 +83,10 @@ func TestClient_toResponse(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() - c := New(nil, nil, nil, "clusterID", "version", time.Second, time.Minute) + c := New(nil, nil, nil, "podName", "clusterID", "version", time.Second, time.Minute) got := c.toResponse(tt.args.resp) - //diff := cmp.Diff(got, tt.want, protocmp.Transform()) - //require.Empty(t, diff) + // diff := cmp.Diff(got, tt.want, protocmp.Transform()) + // require.Empty(t, diff). require.Equal(t, tt.want, got) }) } @@ -145,7 +146,7 @@ func TestClient_toHTTPRequest(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() - c := New(nil, nil, nil, "clusterID", "version", time.Second, time.Minute) + c := New(nil, nil, nil, "podName", "clusterID", "version", time.Second, time.Minute) got, err := c.toHTTPRequest(tt.args.req) require.Equal(t, tt.wantErr, err != nil, err) if err != nil { @@ -221,6 +222,7 @@ func TestClient_handleMessage(t *testing.T) { Request: &cloudproxyv1alpha.StreamCloudProxyRequest_Response{ Response: &cloudproxyv1alpha.ClusterResponse{ ClientMetadata: &cloudproxyv1alpha.ClientMetadata{ + PodName: "podName", ClusterId: "clusterID", }, MessageId: "msgID", @@ -253,7 +255,7 @@ func TestClient_handleMessage(t *testing.T) { if tt.fields.tuneMockCloudClient != nil { tt.fields.tuneMockCloudClient(cloudClient) } - c := New(nil, cloudClient, logrus.New(), "clusterID", "version", config.KeepAliveDefault, config.KeepAliveTimeoutDefault) + c := New(nil, cloudClient, logrus.New(), "podName", "clusterID", "version", config.KeepAliveDefault, config.KeepAliveTimeoutDefault) stream := mock_proxy.NewMockCloudProxyAPI_StreamCloudProxyClient(ctrl) if tt.args.tuneMockStream != nil { tt.args.tuneMockStream(stream) @@ -338,8 +340,8 @@ func TestClient_processHttpRequest(t *testing.T) { if tt.fields.tuneMockCloudClient != nil { tt.fields.tuneMockCloudClient(cloudClient) } - c := New(nil, cloudClient, logrus.New(), "clusterID", "version", time.Second, time.Minute) - if got := c.processHttpRequest(tt.args.req); !reflect.DeepEqual(got, tt.want) { + c := New(nil, cloudClient, logrus.New(), "podName", "clusterID", "version", time.Second, time.Minute) + if got := c.processHTTPRequest(tt.args.req); !reflect.DeepEqual(got, tt.want) { t.Errorf("processHttpRequest() = %v, want %v", got, tt.want) } require.Equal(t, tt.wantProcessCount, c.processedCount.Load(), "processedCount: %v", c.processedCount.Load()) @@ -390,7 +392,8 @@ func TestClient_sendKeepAlive(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - c := New(nil, nil, logrus.New(), "clusterID", "version", config.KeepAliveDefault, config.KeepAliveTimeoutDefault) + c := New(nil, nil, logrus.New(), "podName", "clusterID", + "version", config.KeepAliveDefault, config.KeepAliveTimeoutDefault) c.keepAlive.Store(tt.args.keepAlive) c.keepAliveTimeout.Store(tt.args.keepAliveTimeout) @@ -440,8 +443,8 @@ func TestClient_run(t *testing.T) { return ctx }, tuneMockStream: func(m *mock_proxy.MockCloudProxyAPI_StreamCloudProxyClient) { - m.EXPECT().Send(gomock.Any()).Return(nil).AnyTimes() // expected 0 or 1 times - m.EXPECT().Context().Return(context.Background()).AnyTimes() // expected 0 or 1 times + m.EXPECT().Send(gomock.Any()).Return(nil).AnyTimes() // expected 0 or 1 times. + m.EXPECT().Context().Return(context.Background()).AnyTimes() // expected 0 or 1 times. }, }, wantLastSeenUpdated: true, @@ -454,8 +457,8 @@ func TestClient_run(t *testing.T) { return context.Background() }, tuneMockStream: func(m *mock_proxy.MockCloudProxyAPI_StreamCloudProxyClient) { - m.EXPECT().Send(gomock.Any()).Return(nil).AnyTimes() // expected 0 or 1 times - m.EXPECT().Context().Return(context.Background()).AnyTimes() // expected 0 or 1 times + m.EXPECT().Send(gomock.Any()).Return(nil).AnyTimes() // expected 0 or 1 times. + m.EXPECT().Context().Return(context.Background()).AnyTimes() // expected 0 or 1 times. m.EXPECT().Recv().Return(nil, fmt.Errorf("test error")) }, }, @@ -470,7 +473,7 @@ func TestClient_run(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - c := New(nil, nil, logrus.New(), "clusterID", "version", time.Second, time.Second) + c := New(nil, nil, logrus.New(), "podName", "clusterID", "version", time.Second, time.Second) stream := mock_proxy.NewMockCloudProxyAPI_StreamCloudProxyClient(ctrl) if tt.args.tuneMockStream != nil { tt.args.tuneMockStream(stream) diff --git a/proto/gen/proto/v1alpha/proxy.pb.go b/proto/gen/proto/v1alpha/proxy.pb.go index 39cbe4a..1f09b50 100644 --- a/proto/gen/proto/v1alpha/proxy.pb.go +++ b/proto/gen/proto/v1alpha/proxy.pb.go @@ -21,53 +21,53 @@ const ( ) // Status of the cluster client. -type ClientStats_Status int32 +type ClientStats_Stats_Status int32 const ( - ClientStats_UNKNOWN ClientStats_Status = 0 - ClientStats_OK ClientStats_Status = 1 - ClientStats_CLOSING ClientStats_Status = 2 + ClientStats_Stats_UNKNOWN ClientStats_Stats_Status = 0 + ClientStats_Stats_OK ClientStats_Stats_Status = 1 + ClientStats_Stats_CLOSING ClientStats_Stats_Status = 2 ) -// Enum value maps for ClientStats_Status. +// Enum value maps for ClientStats_Stats_Status. var ( - ClientStats_Status_name = map[int32]string{ + ClientStats_Stats_Status_name = map[int32]string{ 0: "UNKNOWN", 1: "OK", 2: "CLOSING", } - ClientStats_Status_value = map[string]int32{ + ClientStats_Stats_Status_value = map[string]int32{ "UNKNOWN": 0, "OK": 1, "CLOSING": 2, } ) -func (x ClientStats_Status) Enum() *ClientStats_Status { - p := new(ClientStats_Status) +func (x ClientStats_Stats_Status) Enum() *ClientStats_Stats_Status { + p := new(ClientStats_Stats_Status) *p = x return p } -func (x ClientStats_Status) String() string { +func (x ClientStats_Stats_Status) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (ClientStats_Status) Descriptor() protoreflect.EnumDescriptor { +func (ClientStats_Stats_Status) Descriptor() protoreflect.EnumDescriptor { return file_proto_v1alpha_proxy_proto_enumTypes[0].Descriptor() } -func (ClientStats_Status) Type() protoreflect.EnumType { +func (ClientStats_Stats_Status) Type() protoreflect.EnumType { return &file_proto_v1alpha_proxy_proto_enumTypes[0] } -func (x ClientStats_Status) Number() protoreflect.EnumNumber { +func (x ClientStats_Stats_Status) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use ClientStats_Status.Descriptor instead. -func (ClientStats_Status) EnumDescriptor() ([]byte, []int) { - return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{2, 0} +// Deprecated: Use ClientStats_Stats_Status.Descriptor instead. +func (ClientStats_Stats_Status) EnumDescriptor() ([]byte, []int) { + return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{2, 0, 0} } type StreamCloudProxyRequest struct { @@ -227,16 +227,7 @@ type ClientStats struct { unknownFields protoimpl.UnknownFields ClientMetadata *ClientMetadata `protobuf:"bytes,1,opt,name=client_metadata,json=clientMetadata,proto3" json:"client_metadata,omitempty"` - Status ClientStats_Status `protobuf:"varint,2,opt,name=status,proto3,enum=cloud.proxy.v1alpha.ClientStats_Status" json:"status,omitempty"` - // The total number of RPCs that started. - NumCallsStarted int64 `protobuf:"varint,3,opt,name=num_calls_started,json=numCallsStarted,proto3" json:"num_calls_started,omitempty"` - // The total number of RPCs that finished. - NumCallsFinished int64 `protobuf:"varint,4,opt,name=num_calls_finished,json=numCallsFinished,proto3" json:"num_calls_finished,omitempty"` - // The total number of RPCs that failed to reach a server except dropped RPCs. - NumCallsFinishedWithClientFailedToSend int64 `protobuf:"varint,5,opt,name=num_calls_finished_with_client_failed_to_send,json=numCallsFinishedWithClientFailedToSend,proto3" json:"num_calls_finished_with_client_failed_to_send,omitempty"` - // The total number of RPCs that finished and are known to have been received - // by a server. - NumCallsFinishedKnownReceived int64 `protobuf:"varint,6,opt,name=num_calls_finished_known_received,json=numCallsFinishedKnownReceived,proto3" json:"num_calls_finished_known_received,omitempty"` + Stats *ClientStats_Stats `protobuf:"bytes,2,opt,name=stats,proto3" json:"stats,omitempty"` } func (x *ClientStats) Reset() { @@ -278,39 +269,11 @@ func (x *ClientStats) GetClientMetadata() *ClientMetadata { return nil } -func (x *ClientStats) GetStatus() ClientStats_Status { - if x != nil { - return x.Status - } - return ClientStats_UNKNOWN -} - -func (x *ClientStats) GetNumCallsStarted() int64 { +func (x *ClientStats) GetStats() *ClientStats_Stats { if x != nil { - return x.NumCallsStarted - } - return 0 -} - -func (x *ClientStats) GetNumCallsFinished() int64 { - if x != nil { - return x.NumCallsFinished + return x.Stats } - return 0 -} - -func (x *ClientStats) GetNumCallsFinishedWithClientFailedToSend() int64 { - if x != nil { - return x.NumCallsFinishedWithClientFailedToSend - } - return 0 -} - -func (x *ClientStats) GetNumCallsFinishedKnownReceived() int64 { - if x != nil { - return x.NumCallsFinishedKnownReceived - } - return 0 + return nil } type ClusterResponse struct { @@ -635,7 +598,7 @@ type HTTPResponse struct { Body []byte `protobuf:"bytes,1,opt,name=body,proto3,oneof" json:"body,omitempty"` Error *string `protobuf:"bytes,2,opt,name=error,proto3,oneof" json:"error,omitempty"` - Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` + Status int64 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"` Headers map[string]*HeaderValue `protobuf:"bytes,4,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } @@ -685,7 +648,7 @@ func (x *HTTPResponse) GetError() string { return "" } -func (x *HTTPResponse) GetStatus() int32 { +func (x *HTTPResponse) GetStatus() int64 { if x != nil { return x.Status } @@ -863,8 +826,7 @@ type ClientMetadata struct { ClusterId string `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` OrganizationId *string `protobuf:"bytes,2,opt,name=organization_id,json=organizationId,proto3,oneof" json:"organization_id,omitempty"` - Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` - PodName string `protobuf:"bytes,4,opt,name=pod_name,json=podName,proto3" json:"pod_name,omitempty"` + PodName string `protobuf:"bytes,3,opt,name=pod_name,json=podName,proto3" json:"pod_name,omitempty"` } func (x *ClientMetadata) Reset() { @@ -913,219 +875,319 @@ func (x *ClientMetadata) GetOrganizationId() string { return "" } -func (x *ClientMetadata) GetNamespace() string { +func (x *ClientMetadata) GetPodName() string { if x != nil { - return x.Namespace + return x.PodName } return "" } -func (x *ClientMetadata) GetPodName() string { +type ClientStats_Stats struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status ClientStats_Stats_Status `protobuf:"varint,2,opt,name=status,proto3,enum=castai.cloud.proxy.v1alpha.ClientStats_Stats_Status" json:"status,omitempty"` + Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // The total number of RPCs that started. + NumCallsStarted int64 `protobuf:"varint,4,opt,name=num_calls_started,json=numCallsStarted,proto3" json:"num_calls_started,omitempty"` + // The total number of RPCs that finished. + NumCallsFinished int64 `protobuf:"varint,5,opt,name=num_calls_finished,json=numCallsFinished,proto3" json:"num_calls_finished,omitempty"` + // The total number of RPCs that failed to reach a server except dropped RPCs. + NumCallsFinishedWithClientFailedToSend int64 `protobuf:"varint,6,opt,name=num_calls_finished_with_client_failed_to_send,json=numCallsFinishedWithClientFailedToSend,proto3" json:"num_calls_finished_with_client_failed_to_send,omitempty"` + // The total number of RPCs that finished and are known to have been received + // by a server. + NumCallsFinishedKnownReceived int64 `protobuf:"varint,7,opt,name=num_calls_finished_known_received,json=numCallsFinishedKnownReceived,proto3" json:"num_calls_finished_known_received,omitempty"` +} + +func (x *ClientStats_Stats) Reset() { + *x = ClientStats_Stats{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_v1alpha_proxy_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClientStats_Stats) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientStats_Stats) ProtoMessage() {} + +func (x *ClientStats_Stats) ProtoReflect() protoreflect.Message { + mi := &file_proto_v1alpha_proxy_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientStats_Stats.ProtoReflect.Descriptor instead. +func (*ClientStats_Stats) Descriptor() ([]byte, []int) { + return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *ClientStats_Stats) GetStatus() ClientStats_Stats_Status { if x != nil { - return x.PodName + return x.Status } - return "" + return ClientStats_Stats_UNKNOWN +} + +func (x *ClientStats_Stats) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *ClientStats_Stats) GetNumCallsStarted() int64 { + if x != nil { + return x.NumCallsStarted + } + return 0 +} + +func (x *ClientStats_Stats) GetNumCallsFinished() int64 { + if x != nil { + return x.NumCallsFinished + } + return 0 +} + +func (x *ClientStats_Stats) GetNumCallsFinishedWithClientFailedToSend() int64 { + if x != nil { + return x.NumCallsFinishedWithClientFailedToSend + } + return 0 +} + +func (x *ClientStats_Stats) GetNumCallsFinishedKnownReceived() int64 { + if x != nil { + return x.NumCallsFinishedKnownReceived + } + return 0 } var File_proto_v1alpha_proxy_proto protoreflect.FileDescriptor var file_proto_v1alpha_proxy_proto_rawDesc = []byte{ 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x22, 0x89, 0x02, 0x0a, 0x17, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, - 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x58, 0x0a, 0x0f, - 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x49, 0x6e, 0x69, 0x74, - 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x48, 0x00, - 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x42, 0x0a, - 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x82, 0x01, 0x0a, - 0x18, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x0f, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x22, 0xcb, 0x03, 0x0a, 0x0b, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x73, 0x12, 0x4c, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, - 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, - 0x3f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x27, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x63, 0x61, 0x73, + 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x22, 0x9e, 0x02, 0x0a, 0x17, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x5f, 0x0a, 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, + 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, + 0x6c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, + 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x73, 0x12, 0x49, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0x0a, + 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x89, 0x01, 0x0a, 0x18, 0x49, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, + 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xcc, 0x04, 0x0a, 0x0b, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, + 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, + 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x43, 0x0a, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, + 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x2a, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6e, 0x75, 0x6d, - 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x12, - 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, - 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, - 0x6c, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x5d, 0x0a, 0x2d, 0x6e, 0x75, - 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, - 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x66, 0x61, 0x69, - 0x6c, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x26, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x73, - 0x68, 0x65, 0x64, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x61, 0x69, - 0x6c, 0x65, 0x64, 0x54, 0x6f, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x48, 0x0a, 0x21, 0x6e, 0x75, 0x6d, - 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x5f, - 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x1d, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x46, 0x69, - 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x63, 0x65, 0x69, - 0x76, 0x65, 0x64, 0x22, 0x2a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, - 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, - 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4c, 0x4f, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x22, - 0xdf, 0x01, 0x0a, 0x0f, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x0d, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, - 0x0c, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x12, 0x0a, - 0x10, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x22, 0x8d, 0x01, 0x0a, 0x11, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x48, 0x0a, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, - 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, - 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x22, 0xfa, 0x02, 0x0a, 0x18, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, - 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, - 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x1a, 0xa2, + 0x03, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x4c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x34, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, + 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, + 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0f, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, + 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x66, 0x69, + 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6e, 0x75, + 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x5d, + 0x0a, 0x2d, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x69, + 0x73, 0x68, 0x65, 0x64, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x26, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x46, + 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x54, 0x6f, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x48, 0x0a, + 0x21, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, + 0x68, 0x65, 0x64, 0x5f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1d, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, + 0x6c, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x52, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x22, 0x2a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x06, + 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4c, 0x4f, 0x53, 0x49, 0x4e, + 0x47, 0x10, 0x02, 0x22, 0xed, 0x01, 0x0a, 0x0f, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2a, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, - 0x12, 0x48, 0x0a, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, - 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x01, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x12, 0x63, 0x0a, 0x15, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x48, 0x02, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x42, + 0x12, 0x4d, 0x0a, 0x0d, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x52, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x42, 0x18, 0x0a, 0x16, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x63, - 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, - 0x6c, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6b, 0x65, 0x65, 0x70, - 0x41, 0x6c, 0x69, 0x76, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x6c, - 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x10, 0x6b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x22, 0x82, 0x02, 0x0a, 0x0b, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, - 0x17, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x88, 0x01, 0x01, 0x12, 0x47, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x73, 0x1a, 0x5c, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, - 0x07, 0x0a, 0x05, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x95, 0x02, 0x0a, 0x0c, 0x48, 0x54, 0x54, - 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x62, 0x6f, 0x64, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x88, - 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x01, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x48, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, - 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x1a, - 0x5c, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x07, 0x0a, - 0x05, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x22, 0x23, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa7, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, - 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x0f, - 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x43, 0x0a, 0x0c, 0x68, 0x74, - 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x73, 0x0a, 0x13, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0d, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x61, 0x74, 0x61, 0x22, 0x94, 0x01, 0x0a, 0x11, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, + 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x4f, 0x0a, 0x0c, 0x68, 0x74, 0x74, 0x70, + 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, + 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x68, 0x74, + 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x8f, 0x03, 0x0a, 0x18, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2a, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0e, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, + 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, + 0x12, 0x4f, 0x0a, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x52, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x22, 0xaa, 0x01, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x64, 0x88, 0x01, 0x01, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6f, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x12, 0x0a, - 0x10, 0x5f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, - 0x64, 0x32, 0xea, 0x01, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, - 0x41, 0x50, 0x49, 0x12, 0x75, 0x0a, 0x10, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x2c, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, + 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x01, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, + 0x01, 0x12, 0x6a, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x30, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x48, 0x02, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x42, 0x12, 0x0a, + 0x10, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x42, 0x18, 0x0a, 0x16, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x63, 0x0a, 0x14, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x6c, 0x69, + 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6b, 0x65, 0x65, 0x70, 0x41, 0x6c, + 0x69, 0x76, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x6c, 0x69, 0x76, + 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x10, 0x6b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x22, 0x90, 0x02, 0x0a, 0x0b, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x17, 0x0a, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x88, 0x01, 0x01, 0x12, 0x4e, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x1a, 0x63, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, + 0x62, 0x6f, 0x64, 0x79, 0x22, 0xa3, 0x02, 0x0a, 0x0c, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x88, 0x01, 0x01, 0x12, 0x19, + 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x4f, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, + 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x73, 0x1a, 0x63, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x62, 0x6f, 0x64, 0x79, + 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x23, 0x0a, 0x0b, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0xb5, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2a, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, + 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x4a, 0x0a, 0x0c, 0x68, + 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, + 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x7a, 0x0a, 0x13, 0x53, 0x65, 0x6e, 0x64, 0x54, + 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, + 0x0a, 0x0d, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, + 0x0c, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x22, 0x8c, 0x01, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6f, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x12, + 0x0a, 0x10, 0x5f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x32, 0x87, 0x02, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, + 0x79, 0x41, 0x50, 0x49, 0x12, 0x83, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, + 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x33, 0x2e, 0x63, 0x61, 0x73, 0x74, + 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, + 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, + 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x62, 0x0a, 0x0b, 0x53, 0x65, - 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x27, 0x2e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x49, - 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x61, 0x73, - 0x74, 0x61, 0x69, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x70, 0x0a, 0x0b, 0x53, 0x65, + 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x2e, 0x2e, 0x63, 0x61, 0x73, 0x74, + 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, + 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x61, 0x73, 0x74, + 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, + 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x49, 0x5a, 0x47, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x61, 0x73, 0x74, 0x61, + 0x69, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1141,54 +1203,56 @@ func file_proto_v1alpha_proxy_proto_rawDescGZIP() []byte { } var file_proto_v1alpha_proxy_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proto_v1alpha_proxy_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_proto_v1alpha_proxy_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_proto_v1alpha_proxy_proto_goTypes = []any{ - (ClientStats_Status)(0), // 0: cloud.proxy.v1alpha.ClientStats.Status - (*StreamCloudProxyRequest)(nil), // 1: cloud.proxy.v1alpha.StreamCloudProxyRequest - (*InitialCloudProxyRequest)(nil), // 2: cloud.proxy.v1alpha.InitialCloudProxyRequest - (*ClientStats)(nil), // 3: cloud.proxy.v1alpha.ClientStats - (*ClusterResponse)(nil), // 4: cloud.proxy.v1alpha.ClusterResponse - (*CloudProxyRequest)(nil), // 5: cloud.proxy.v1alpha.CloudProxyRequest - (*StreamCloudProxyResponse)(nil), // 6: cloud.proxy.v1alpha.StreamCloudProxyResponse - (*ConfigurationRequest)(nil), // 7: cloud.proxy.v1alpha.ConfigurationRequest - (*HTTPRequest)(nil), // 8: cloud.proxy.v1alpha.HTTPRequest - (*HTTPResponse)(nil), // 9: cloud.proxy.v1alpha.HTTPResponse - (*HeaderValue)(nil), // 10: cloud.proxy.v1alpha.HeaderValue - (*SendToProxyRequest)(nil), // 11: cloud.proxy.v1alpha.SendToProxyRequest - (*SendToProxyResponse)(nil), // 12: cloud.proxy.v1alpha.SendToProxyResponse - (*ClientMetadata)(nil), // 13: cloud.proxy.v1alpha.ClientMetadata - nil, // 14: cloud.proxy.v1alpha.HTTPRequest.HeadersEntry - nil, // 15: cloud.proxy.v1alpha.HTTPResponse.HeadersEntry + (ClientStats_Stats_Status)(0), // 0: castai.cloud.proxy.v1alpha.ClientStats.Stats.Status + (*StreamCloudProxyRequest)(nil), // 1: castai.cloud.proxy.v1alpha.StreamCloudProxyRequest + (*InitialCloudProxyRequest)(nil), // 2: castai.cloud.proxy.v1alpha.InitialCloudProxyRequest + (*ClientStats)(nil), // 3: castai.cloud.proxy.v1alpha.ClientStats + (*ClusterResponse)(nil), // 4: castai.cloud.proxy.v1alpha.ClusterResponse + (*CloudProxyRequest)(nil), // 5: castai.cloud.proxy.v1alpha.CloudProxyRequest + (*StreamCloudProxyResponse)(nil), // 6: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse + (*ConfigurationRequest)(nil), // 7: castai.cloud.proxy.v1alpha.ConfigurationRequest + (*HTTPRequest)(nil), // 8: castai.cloud.proxy.v1alpha.HTTPRequest + (*HTTPResponse)(nil), // 9: castai.cloud.proxy.v1alpha.HTTPResponse + (*HeaderValue)(nil), // 10: castai.cloud.proxy.v1alpha.HeaderValue + (*SendToProxyRequest)(nil), // 11: castai.cloud.proxy.v1alpha.SendToProxyRequest + (*SendToProxyResponse)(nil), // 12: castai.cloud.proxy.v1alpha.SendToProxyResponse + (*ClientMetadata)(nil), // 13: castai.cloud.proxy.v1alpha.ClientMetadata + (*ClientStats_Stats)(nil), // 14: castai.cloud.proxy.v1alpha.ClientStats.Stats + nil, // 15: castai.cloud.proxy.v1alpha.HTTPRequest.HeadersEntry + nil, // 16: castai.cloud.proxy.v1alpha.HTTPResponse.HeadersEntry } var file_proto_v1alpha_proxy_proto_depIdxs = []int32{ - 2, // 0: cloud.proxy.v1alpha.StreamCloudProxyRequest.initial_request:type_name -> cloud.proxy.v1alpha.InitialCloudProxyRequest - 3, // 1: cloud.proxy.v1alpha.StreamCloudProxyRequest.client_stats:type_name -> cloud.proxy.v1alpha.ClientStats - 4, // 2: cloud.proxy.v1alpha.StreamCloudProxyRequest.response:type_name -> cloud.proxy.v1alpha.ClusterResponse - 13, // 3: cloud.proxy.v1alpha.InitialCloudProxyRequest.client_metadata:type_name -> cloud.proxy.v1alpha.ClientMetadata - 13, // 4: cloud.proxy.v1alpha.ClientStats.client_metadata:type_name -> cloud.proxy.v1alpha.ClientMetadata - 0, // 5: cloud.proxy.v1alpha.ClientStats.status:type_name -> cloud.proxy.v1alpha.ClientStats.Status - 13, // 6: cloud.proxy.v1alpha.ClusterResponse.client_metadata:type_name -> cloud.proxy.v1alpha.ClientMetadata - 9, // 7: cloud.proxy.v1alpha.ClusterResponse.http_response:type_name -> cloud.proxy.v1alpha.HTTPResponse - 8, // 8: cloud.proxy.v1alpha.CloudProxyRequest.http_request:type_name -> cloud.proxy.v1alpha.HTTPRequest - 13, // 9: cloud.proxy.v1alpha.StreamCloudProxyResponse.client_metadata:type_name -> cloud.proxy.v1alpha.ClientMetadata - 8, // 10: cloud.proxy.v1alpha.StreamCloudProxyResponse.http_request:type_name -> cloud.proxy.v1alpha.HTTPRequest - 7, // 11: cloud.proxy.v1alpha.StreamCloudProxyResponse.configuration_request:type_name -> cloud.proxy.v1alpha.ConfigurationRequest - 14, // 12: cloud.proxy.v1alpha.HTTPRequest.headers:type_name -> cloud.proxy.v1alpha.HTTPRequest.HeadersEntry - 15, // 13: cloud.proxy.v1alpha.HTTPResponse.headers:type_name -> cloud.proxy.v1alpha.HTTPResponse.HeadersEntry - 13, // 14: cloud.proxy.v1alpha.SendToProxyRequest.client_metadata:type_name -> cloud.proxy.v1alpha.ClientMetadata - 8, // 15: cloud.proxy.v1alpha.SendToProxyRequest.http_request:type_name -> cloud.proxy.v1alpha.HTTPRequest - 9, // 16: cloud.proxy.v1alpha.SendToProxyResponse.http_response:type_name -> cloud.proxy.v1alpha.HTTPResponse - 10, // 17: cloud.proxy.v1alpha.HTTPRequest.HeadersEntry.value:type_name -> cloud.proxy.v1alpha.HeaderValue - 10, // 18: cloud.proxy.v1alpha.HTTPResponse.HeadersEntry.value:type_name -> cloud.proxy.v1alpha.HeaderValue - 1, // 19: cloud.proxy.v1alpha.CloudProxyAPI.StreamCloudProxy:input_type -> cloud.proxy.v1alpha.StreamCloudProxyRequest - 11, // 20: cloud.proxy.v1alpha.CloudProxyAPI.SendToProxy:input_type -> cloud.proxy.v1alpha.SendToProxyRequest - 6, // 21: cloud.proxy.v1alpha.CloudProxyAPI.StreamCloudProxy:output_type -> cloud.proxy.v1alpha.StreamCloudProxyResponse - 12, // 22: cloud.proxy.v1alpha.CloudProxyAPI.SendToProxy:output_type -> cloud.proxy.v1alpha.SendToProxyResponse - 21, // [21:23] is the sub-list for method output_type - 19, // [19:21] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name + 2, // 0: castai.cloud.proxy.v1alpha.StreamCloudProxyRequest.initial_request:type_name -> castai.cloud.proxy.v1alpha.InitialCloudProxyRequest + 3, // 1: castai.cloud.proxy.v1alpha.StreamCloudProxyRequest.client_stats:type_name -> castai.cloud.proxy.v1alpha.ClientStats + 4, // 2: castai.cloud.proxy.v1alpha.StreamCloudProxyRequest.response:type_name -> castai.cloud.proxy.v1alpha.ClusterResponse + 13, // 3: castai.cloud.proxy.v1alpha.InitialCloudProxyRequest.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata + 13, // 4: castai.cloud.proxy.v1alpha.ClientStats.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata + 14, // 5: castai.cloud.proxy.v1alpha.ClientStats.stats:type_name -> castai.cloud.proxy.v1alpha.ClientStats.Stats + 13, // 6: castai.cloud.proxy.v1alpha.ClusterResponse.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata + 9, // 7: castai.cloud.proxy.v1alpha.ClusterResponse.http_response:type_name -> castai.cloud.proxy.v1alpha.HTTPResponse + 8, // 8: castai.cloud.proxy.v1alpha.CloudProxyRequest.http_request:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest + 13, // 9: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata + 8, // 10: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse.http_request:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest + 7, // 11: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse.configuration_request:type_name -> castai.cloud.proxy.v1alpha.ConfigurationRequest + 15, // 12: castai.cloud.proxy.v1alpha.HTTPRequest.headers:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest.HeadersEntry + 16, // 13: castai.cloud.proxy.v1alpha.HTTPResponse.headers:type_name -> castai.cloud.proxy.v1alpha.HTTPResponse.HeadersEntry + 13, // 14: castai.cloud.proxy.v1alpha.SendToProxyRequest.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata + 8, // 15: castai.cloud.proxy.v1alpha.SendToProxyRequest.http_request:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest + 9, // 16: castai.cloud.proxy.v1alpha.SendToProxyResponse.http_response:type_name -> castai.cloud.proxy.v1alpha.HTTPResponse + 0, // 17: castai.cloud.proxy.v1alpha.ClientStats.Stats.status:type_name -> castai.cloud.proxy.v1alpha.ClientStats.Stats.Status + 10, // 18: castai.cloud.proxy.v1alpha.HTTPRequest.HeadersEntry.value:type_name -> castai.cloud.proxy.v1alpha.HeaderValue + 10, // 19: castai.cloud.proxy.v1alpha.HTTPResponse.HeadersEntry.value:type_name -> castai.cloud.proxy.v1alpha.HeaderValue + 1, // 20: castai.cloud.proxy.v1alpha.CloudProxyAPI.StreamCloudProxy:input_type -> castai.cloud.proxy.v1alpha.StreamCloudProxyRequest + 11, // 21: castai.cloud.proxy.v1alpha.CloudProxyAPI.SendToProxy:input_type -> castai.cloud.proxy.v1alpha.SendToProxyRequest + 6, // 22: castai.cloud.proxy.v1alpha.CloudProxyAPI.StreamCloudProxy:output_type -> castai.cloud.proxy.v1alpha.StreamCloudProxyResponse + 12, // 23: castai.cloud.proxy.v1alpha.CloudProxyAPI.SendToProxy:output_type -> castai.cloud.proxy.v1alpha.SendToProxyResponse + 22, // [22:24] is the sub-list for method output_type + 20, // [20:22] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_proto_v1alpha_proxy_proto_init() } @@ -1353,6 +1417,18 @@ func file_proto_v1alpha_proxy_proto_init() { return nil } } + file_proto_v1alpha_proxy_proto_msgTypes[13].Exporter = func(v any, i int) any { + switch v := v.(*ClientStats_Stats); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_proto_v1alpha_proxy_proto_msgTypes[0].OneofWrappers = []any{ (*StreamCloudProxyRequest_InitialRequest)(nil), @@ -1371,7 +1447,7 @@ func file_proto_v1alpha_proxy_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_v1alpha_proxy_proto_rawDesc, NumEnums: 1, - NumMessages: 15, + NumMessages: 16, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/gen/proto/v1alpha/proxy_grpc.pb.go b/proto/gen/proto/v1alpha/proxy_grpc.pb.go index 4901911..3182cc3 100644 --- a/proto/gen/proto/v1alpha/proxy_grpc.pb.go +++ b/proto/gen/proto/v1alpha/proxy_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v5.27.3 +// - protoc v5.28.0 // source: proto/v1alpha/proxy.proto package cloudproxyv1alpha diff --git a/proto/v1alpha/proxy.proto b/proto/v1alpha/proxy.proto index 526c874..3db2f15 100644 --- a/proto/v1alpha/proxy.proto +++ b/proto/v1alpha/proxy.proto @@ -31,31 +31,36 @@ message InitialCloudProxyRequest { string version = 2; } + message ClientStats { ClientMetadata client_metadata = 1; - - // Status of the cluster client. - enum Status { - UNKNOWN = 0; - OK = 1; - CLOSING = 2; + message Stats { + // Status of the cluster client. + enum Status { + UNKNOWN = 0; + OK = 1; + CLOSING = 2; + } + Status status = 2; + + int64 timestamp = 3; + // The total number of RPCs that started. + int64 num_calls_started = 4; + + // The total number of RPCs that finished. + int64 num_calls_finished = 5; + + // The total number of RPCs that failed to reach a server except dropped RPCs. + int64 num_calls_finished_with_client_failed_to_send = 6; + + // The total number of RPCs that finished and are known to have been received + // by a server. + int64 num_calls_finished_known_received = 7; } - Status status = 2; - - // The total number of RPCs that started. - int64 num_calls_started = 3; - - // The total number of RPCs that finished. - int64 num_calls_finished = 4; - - // The total number of RPCs that failed to reach a server except dropped RPCs. - int64 num_calls_finished_with_client_failed_to_send = 5; - - // The total number of RPCs that finished and are known to have been received - // by a server. - int64 num_calls_finished_known_received = 6; + Stats stats = 2; } + message ClusterResponse { optional ClientMetadata client_metadata = 1; string message_id = 2; @@ -89,7 +94,7 @@ message HTTPRequest { message HTTPResponse { optional bytes body = 1; optional string error = 2; - int32 status = 3; + int64 status = 3; map headers = 4; } @@ -110,6 +115,5 @@ message SendToProxyResponse { message ClientMetadata { string cluster_id = 1; optional string organization_id = 2; - string namespace = 3; - string pod_name = 4; + string pod_name = 3; }