From 2cec6836756d65f8e60af0d1752781bb85010d21 Mon Sep 17 00:00:00 2001 From: Tony Allen Date: Thu, 2 Apr 2020 13:34:49 -0700 Subject: [PATCH 1/2] Add gRPC status proto definitions Signed-off-by: Tony Allen --- api/BUILD | 2 ++ api/envoy/type/grpc/v2/BUILD | 9 +++++ api/envoy/type/grpc/v2/grpc_status.proto | 40 ++++++++++++++++++++++ api/envoy/type/grpc/v3/BUILD | 12 +++++++ api/envoy/type/grpc/v3/grpc_status.proto | 42 ++++++++++++++++++++++++ 5 files changed, 105 insertions(+) create mode 100644 api/envoy/type/grpc/v2/BUILD create mode 100644 api/envoy/type/grpc/v2/grpc_status.proto create mode 100644 api/envoy/type/grpc/v3/BUILD create mode 100644 api/envoy/type/grpc/v3/grpc_status.proto diff --git a/api/BUILD b/api/BUILD index 29f8807e3248..5cf6371927f0 100644 --- a/api/BUILD +++ b/api/BUILD @@ -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", @@ -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", diff --git a/api/envoy/type/grpc/v2/BUILD b/api/envoy/type/grpc/v2/BUILD new file mode 100644 index 000000000000..ef3541ebcb1d --- /dev/null +++ b/api/envoy/type/grpc/v2/BUILD @@ -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"], +) diff --git a/api/envoy/type/grpc/v2/grpc_status.proto b/api/envoy/type/grpc/v2/grpc_status.proto new file mode 100644 index 000000000000..81c2345b6542 --- /dev/null +++ b/api/envoy/type/grpc/v2/grpc_status.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; + +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 { + 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 not_in: 0}]; +} diff --git a/api/envoy/type/grpc/v3/BUILD b/api/envoy/type/grpc/v3/BUILD new file mode 100644 index 000000000000..0386b2873e04 --- /dev/null +++ b/api/envoy/type/grpc/v3/BUILD @@ -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", + ], +) diff --git a/api/envoy/type/grpc/v3/grpc_status.proto b/api/envoy/type/grpc/v3/grpc_status.proto new file mode 100644 index 000000000000..72c64e255b24 --- /dev/null +++ b/api/envoy/type/grpc/v3/grpc_status.proto @@ -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 not_in: 0}]; +} From 174eed8f57c3e67b569ce483b3ee67d3da183235 Mon Sep 17 00:00:00 2001 From: Tony Allen Date: Thu, 2 Apr 2020 17:14:59 -0700 Subject: [PATCH 2/2] comments Signed-off-by: Tony Allen --- api/envoy/type/grpc/v2/grpc_status.proto | 10 +++++----- api/envoy/type/grpc/v3/grpc_status.proto | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/envoy/type/grpc/v2/grpc_status.proto b/api/envoy/type/grpc/v2/grpc_status.proto index 81c2345b6542..43cf6666298f 100644 --- a/api/envoy/type/grpc/v2/grpc_status.proto +++ b/api/envoy/type/grpc/v2/grpc_status.proto @@ -10,9 +10,9 @@ 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] +// [#protodoc-title: gRPC status codes] -// GRPC response codes supported. +// gRPC response codes supported. enum Status { OK = 0; CANCELED = 1; @@ -33,8 +33,8 @@ enum Status { UNAUTHENTICATED = 16; } -// GRPC status. +// gRPC status. message GrpcStatus { - // Supplies GRPC response code. - Status status = 1 [(validate.rules).enum = {defined_only: true not_in: 0}]; + // Supplies gRPC response code. + Status status = 1 [(validate.rules).enum = {defined_only: true}]; } diff --git a/api/envoy/type/grpc/v3/grpc_status.proto b/api/envoy/type/grpc/v3/grpc_status.proto index 72c64e255b24..2fc8e2f2d8b7 100644 --- a/api/envoy/type/grpc/v3/grpc_status.proto +++ b/api/envoy/type/grpc/v3/grpc_status.proto @@ -10,9 +10,9 @@ option java_package = "io.envoyproxy.envoy.type.grpc.v3"; option java_outer_classname = "GrpcStatusProto"; option java_multiple_files = true; -// [#protodoc-title: GRPC status codes] +// [#protodoc-title: gRPC status codes] -// GRPC response codes supported. +// gRPC response codes supported. enum Status { OK = 0; CANCELED = 1; @@ -33,10 +33,10 @@ enum Status { UNAUTHENTICATED = 16; } -// GRPC status. +// 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 not_in: 0}]; + // Supplies gRPC response code. + Status status = 1 [(validate.rules).enum = {defined_only: true}]; }