Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: Add gRPC status proto definition #10631

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ proto_library(
"//envoy/service/tap/v2alpha:pkg",
"//envoy/service/trace/v2:pkg",
"//envoy/type:pkg",
"//envoy/type/grpc/v2:pkg",
"//envoy/type/matcher:pkg",
"//envoy/type/metadata/v2:pkg",
"//envoy/type/tracing/v2:pkg",
Expand Down Expand Up @@ -244,6 +245,7 @@ proto_library(
"//envoy/service/tap/v3:pkg",
"//envoy/service/trace/v3:pkg",
"//envoy/type/matcher/v3:pkg",
"//envoy/type/grpc/v2:pkg",
"//envoy/type/metadata/v3:pkg",
"//envoy/type/tracing/v3:pkg",
"//envoy/type/v3:pkg",
Expand Down
9 changes: 9 additions & 0 deletions api/envoy/type/grpc/v2/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# DO NOT EDIT. This file is generated by tools/proto_sync.py.

load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")

licenses(["notice"]) # Apache 2

api_proto_package(
deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"],
)
40 changes: 40 additions & 0 deletions api/envoy/type/grpc/v2/grpc_status.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
syntax = "proto3";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this used or planned to be used?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the linked PR in the description.


package envoy.type.grpc.v2;

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

option java_package = "io.envoyproxy.envoy.type.grpc.v2";
option java_outer_classname = "GrpcStatusProto";
option java_multiple_files = true;
option (udpa.annotations.file_migrate).move_to_package = "envoy.type.grpc.v3";

// [#protodoc-title: gRPC status codes]

// gRPC response codes supported.
enum Status {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See @lizan comment in the other PR about not using an enum for this.

OK = 0;
CANCELED = 1;
UNKNOWN = 2;
INVALID_ARGUMENT = 3;
DEADLINE_EXCEEDED = 4;
NOT_FOUND = 5;
ALREADY_EXISTS = 6;
PERMISSION_DENIED = 7;
RESOURCE_EXHAUSTED = 8;
FAILED_PRECONDITION = 9;
ABORTED = 10;
OUT_OF_RANGE = 11;
UNIMPLEMENTED = 12;
INTERNAL = 13;
UNAVAILABLE = 14;
DATA_LOSS = 15;
UNAUTHENTICATED = 16;
}

// gRPC status.
message GrpcStatus {
// Supplies gRPC response code.
Status status = 1 [(validate.rules).enum = {defined_only: true}];
}
12 changes: 12 additions & 0 deletions api/envoy/type/grpc/v3/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DO NOT EDIT. This file is generated by tools/proto_sync.py.

load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")

licenses(["notice"]) # Apache 2

api_proto_package(
deps = [
"//envoy/type/grpc/v2:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
42 changes: 42 additions & 0 deletions api/envoy/type/grpc/v3/grpc_status.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
syntax = "proto3";

package envoy.type.grpc.v3;

import "udpa/annotations/versioning.proto";

import "validate/validate.proto";

option java_package = "io.envoyproxy.envoy.type.grpc.v3";
option java_outer_classname = "GrpcStatusProto";
option java_multiple_files = true;

// [#protodoc-title: gRPC status codes]

// gRPC response codes supported.
enum Status {
OK = 0;
CANCELED = 1;
UNKNOWN = 2;
INVALID_ARGUMENT = 3;
DEADLINE_EXCEEDED = 4;
NOT_FOUND = 5;
ALREADY_EXISTS = 6;
PERMISSION_DENIED = 7;
RESOURCE_EXHAUSTED = 8;
FAILED_PRECONDITION = 9;
ABORTED = 10;
OUT_OF_RANGE = 11;
UNIMPLEMENTED = 12;
INTERNAL = 13;
UNAVAILABLE = 14;
DATA_LOSS = 15;
UNAUTHENTICATED = 16;
}

// gRPC status.
message GrpcStatus {
option (udpa.annotations.versioning).previous_message_type = "envoy.type.grpc.v2.GrpcStatus";

// Supplies gRPC response code.
Status status = 1 [(validate.rules).enum = {defined_only: true}];
}