From 1e47be6b7cdda42d5f7aa52002ab85af637d3571 Mon Sep 17 00:00:00 2001 From: John Mears Date: Mon, 18 Mar 2024 19:34:24 -0600 Subject: [PATCH] Add support for sending NMI Add SendNMI method to the gRPC diagnostic service. The method has also been added to the client. The version of bmclib is updated to use the new SendNMI code. All of the protobuf go files seem to have changed due to minior formatting changes and comments from a newver version of protoc. Signed-off-by: John Mears --- api/v1/bmc.pb.go | 165 +++++++++++------------ api/v1/bmc.validator.pb.go | 16 +++ api/v1/bmc_grpc.pb.go | 46 +++++-- api/v1/common.pb.go | 29 ++-- api/v1/diagnostic.pb.go | 214 ++++++++++++++++++++---------- api/v1/diagnostic.proto | 9 +- api/v1/diagnostic.validator.pb.go | 9 ++ api/v1/diagnostic_grpc.pb.go | 64 ++++++++- api/v1/machine.pb.go | 9 +- api/v1/machine_grpc.pb.go | 26 +++- api/v1/task.pb.go | 9 +- api/v1/task_grpc.pb.go | 21 ++- client/client.go | 6 + cmd/nmi.go | 57 ++++++++ go.mod | 2 +- go.sum | 4 +- grpc/oob/diagnostic/diagnostic.go | 1 + grpc/oob/diagnostic/nmi.go | 101 ++++++++++++++ grpc/rpc/diagnostic.go | 28 ++++ 19 files changed, 611 insertions(+), 205 deletions(-) create mode 100644 cmd/nmi.go create mode 100644 grpc/oob/diagnostic/nmi.go diff --git a/api/v1/bmc.pb.go b/api/v1/bmc.pb.go index c32ee09..65c98e5 100644 --- a/api/v1/bmc.pb.go +++ b/api/v1/bmc.pb.go @@ -1,17 +1,18 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v3.14.0 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: api/v1/bmc.proto package v1 import ( + reflect "reflect" + sync "sync" + _ "github.com/mwitkow/go-proto-validators" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( @@ -990,87 +991,87 @@ var file_api_v1_bmc_proto_rawDesc = []byte{ 0x64, 0x73, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x64, 0x73, 0x22, 0x2d, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x98, 0x01, 0x0a, - 0x13, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x53, 0x4f, 0x4c, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x05, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6e, 0x52, 0x05, 0x61, - 0x75, 0x74, 0x68, 0x6e, 0x12, 0x41, 0x0a, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x99, 0x01, 0x0a, + 0x14, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x53, 0x4f, 0x4c, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x05, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, - 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x52, - 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x22, 0x2f, 0x0a, 0x14, 0x54, 0x65, 0x72, 0x6d, 0x69, - 0x6e, 0x61, 0x74, 0x65, 0x53, 0x4f, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x2a, 0x4e, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x4c, - 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x13, 0x0a, 0x0f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x44, 0x4d, - 0x49, 0x4e, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x4c, - 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x02, 0x2a, 0x51, 0x0a, 0x09, 0x52, 0x65, 0x73, 0x65, - 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x45, 0x53, 0x45, 0x54, 0x5f, 0x4b, - 0x49, 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x53, 0x45, 0x54, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, - 0x43, 0x4f, 0x4c, 0x44, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x53, 0x45, 0x54, 0x5f, - 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x57, 0x41, 0x52, 0x4d, 0x10, 0x02, 0x2a, 0x63, 0x0a, 0x0d, 0x4e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x1a, - 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, - 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x44, - 0x48, 0x43, 0x50, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, - 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x49, 0x43, 0x10, 0x02, - 0x32, 0xe8, 0x05, 0x0a, 0x03, 0x42, 0x4d, 0x43, 0x12, 0x82, 0x01, 0x0a, 0x0d, 0x4e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x37, 0x2e, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, - 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6a, 0x0a, - 0x05, 0x52, 0x65, 0x73, 0x65, 0x74, 0x12, 0x2f, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, - 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, - 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x65, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x79, 0x0a, 0x0a, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x34, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, - 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, - 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x79, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x12, 0x34, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6e, 0x52, 0x05, + 0x61, 0x75, 0x74, 0x68, 0x6e, 0x12, 0x41, 0x0a, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, + 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x6e, 0x64, 0x6f, 0x72, + 0x52, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x22, 0x30, 0x0a, 0x15, 0x44, 0x65, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x53, 0x4f, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x2a, 0x4e, 0x0a, 0x08, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x52, + 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, + 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x52, + 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x02, 0x2a, 0x51, 0x0a, 0x09, 0x52, 0x65, + 0x73, 0x65, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x45, 0x53, 0x45, 0x54, + 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x53, 0x45, 0x54, 0x5f, 0x4b, 0x49, 0x4e, + 0x44, 0x5f, 0x43, 0x4f, 0x4c, 0x44, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x53, 0x45, + 0x54, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x57, 0x41, 0x52, 0x4d, 0x10, 0x02, 0x2a, 0x63, 0x0a, + 0x0d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1e, + 0x0a, 0x1a, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, + 0x0a, 0x13, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, + 0x5f, 0x44, 0x48, 0x43, 0x50, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x4e, 0x45, 0x54, 0x57, 0x4f, + 0x52, 0x4b, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x49, 0x43, + 0x10, 0x02, 0x32, 0xec, 0x05, 0x0a, 0x03, 0x42, 0x4d, 0x43, 0x12, 0x82, 0x01, 0x0a, 0x0d, 0x4e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x37, 0x2e, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, + 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, + 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x6a, 0x0a, 0x05, 0x52, 0x65, 0x73, 0x65, 0x74, 0x12, 0x2f, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, - 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x79, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x34, 0x2e, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, - 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7f, 0x0a, 0x0c, 0x54, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x53, 0x4f, 0x4c, 0x12, 0x36, 0x2e, 0x67, 0x69, 0x74, + 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, + 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, + 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, + 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x79, 0x0a, 0x0a, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x34, 0x2e, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, + 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x35, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, + 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x79, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x12, 0x34, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, + 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, - 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x54, - 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x53, 0x4f, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, - 0x53, 0x4f, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x33, 0x5a, 0x21, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, - 0x62, 0x65, 0x6c, 0x6c, 0x2f, 0x70, 0x62, 0x6e, 0x6a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, - 0xea, 0x02, 0x0d, 0x50, 0x62, 0x6e, 0x6a, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x79, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, + 0x34, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, + 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, + 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x82, 0x01, 0x0a, + 0x0d, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x53, 0x4f, 0x4c, 0x12, 0x37, + 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, + 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x53, 0x4f, 0x4c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, + 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x53, 0x4f, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x42, 0x33, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2f, 0x70, 0x62, 0x6e, 0x6a, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0xea, 0x02, 0x0d, 0x50, 0x62, 0x6e, 0x6a, 0x3a, 0x3a, 0x41, + 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/v1/bmc.validator.pb.go b/api/v1/bmc.validator.pb.go index c94db19..4d75cd0 100644 --- a/api/v1/bmc.validator.pb.go +++ b/api/v1/bmc.validator.pb.go @@ -128,3 +128,19 @@ func (this *UpdateUserRequest) Validate() error { func (this *UpdateUserResponse) Validate() error { return nil } +func (this *DeactivateSOLRequest) Validate() error { + if this.Authn != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Authn); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Authn", err) + } + } + if this.Vendor != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Vendor); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Vendor", err) + } + } + return nil +} +func (this *DeactivateSOLResponse) Validate() error { + return nil +} diff --git a/api/v1/bmc_grpc.pb.go b/api/v1/bmc_grpc.pb.go index 5504fec..5a9a616 100644 --- a/api/v1/bmc_grpc.pb.go +++ b/api/v1/bmc_grpc.pb.go @@ -1,9 +1,14 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: api/v1/bmc.proto package v1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -11,8 +16,18 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + BMC_NetworkSource_FullMethodName = "/github.com.tinkerbell.pbnj.api.v1.BMC/NetworkSource" + BMC_Reset_FullMethodName = "/github.com.tinkerbell.pbnj.api.v1.BMC/Reset" + BMC_CreateUser_FullMethodName = "/github.com.tinkerbell.pbnj.api.v1.BMC/CreateUser" + BMC_DeleteUser_FullMethodName = "/github.com.tinkerbell.pbnj.api.v1.BMC/DeleteUser" + BMC_UpdateUser_FullMethodName = "/github.com.tinkerbell.pbnj.api.v1.BMC/UpdateUser" + BMC_DeactivateSOL_FullMethodName = "/github.com.tinkerbell.pbnj.api.v1.BMC/DeactivateSOL" +) + // BMCClient is the client API for BMC service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -35,7 +50,7 @@ func NewBMCClient(cc grpc.ClientConnInterface) BMCClient { func (c *bMCClient) NetworkSource(ctx context.Context, in *NetworkSourceRequest, opts ...grpc.CallOption) (*NetworkSourceResponse, error) { out := new(NetworkSourceResponse) - err := c.cc.Invoke(ctx, "/github.com.tinkerbell.pbnj.api.v1.BMC/NetworkSource", in, out, opts...) + err := c.cc.Invoke(ctx, BMC_NetworkSource_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -44,7 +59,7 @@ func (c *bMCClient) NetworkSource(ctx context.Context, in *NetworkSourceRequest, func (c *bMCClient) Reset(ctx context.Context, in *ResetRequest, opts ...grpc.CallOption) (*ResetResponse, error) { out := new(ResetResponse) - err := c.cc.Invoke(ctx, "/github.com.tinkerbell.pbnj.api.v1.BMC/Reset", in, out, opts...) + err := c.cc.Invoke(ctx, BMC_Reset_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -53,7 +68,7 @@ func (c *bMCClient) Reset(ctx context.Context, in *ResetRequest, opts ...grpc.Ca func (c *bMCClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) { out := new(CreateUserResponse) - err := c.cc.Invoke(ctx, "/github.com.tinkerbell.pbnj.api.v1.BMC/CreateUser", in, out, opts...) + err := c.cc.Invoke(ctx, BMC_CreateUser_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -62,7 +77,7 @@ func (c *bMCClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts func (c *bMCClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error) { out := new(DeleteUserResponse) - err := c.cc.Invoke(ctx, "/github.com.tinkerbell.pbnj.api.v1.BMC/DeleteUser", in, out, opts...) + err := c.cc.Invoke(ctx, BMC_DeleteUser_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -71,7 +86,7 @@ func (c *bMCClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts func (c *bMCClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error) { out := new(UpdateUserResponse) - err := c.cc.Invoke(ctx, "/github.com.tinkerbell.pbnj.api.v1.BMC/UpdateUser", in, out, opts...) + err := c.cc.Invoke(ctx, BMC_UpdateUser_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -80,7 +95,7 @@ func (c *bMCClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts func (c *bMCClient) DeactivateSOL(ctx context.Context, in *DeactivateSOLRequest, opts ...grpc.CallOption) (*DeactivateSOLResponse, error) { out := new(DeactivateSOLResponse) - err := c.cc.Invoke(ctx, "/github.com.tinkerbell.pbnj.api.v1.BMC/DeactivateSOL", in, out, opts...) + err := c.cc.Invoke(ctx, BMC_DeactivateSOL_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -132,7 +147,7 @@ type UnsafeBMCServer interface { } func RegisterBMCServer(s grpc.ServiceRegistrar, srv BMCServer) { - s.RegisterService(&_BMC_serviceDesc, srv) + s.RegisterService(&BMC_ServiceDesc, srv) } func _BMC_NetworkSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -145,7 +160,7 @@ func _BMC_NetworkSource_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/github.com.tinkerbell.pbnj.api.v1.BMC/NetworkSource", + FullMethod: BMC_NetworkSource_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BMCServer).NetworkSource(ctx, req.(*NetworkSourceRequest)) @@ -163,7 +178,7 @@ func _BMC_Reset_Handler(srv interface{}, ctx context.Context, dec func(interface } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/github.com.tinkerbell.pbnj.api.v1.BMC/Reset", + FullMethod: BMC_Reset_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BMCServer).Reset(ctx, req.(*ResetRequest)) @@ -181,7 +196,7 @@ func _BMC_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/github.com.tinkerbell.pbnj.api.v1.BMC/CreateUser", + FullMethod: BMC_CreateUser_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BMCServer).CreateUser(ctx, req.(*CreateUserRequest)) @@ -199,7 +214,7 @@ func _BMC_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/github.com.tinkerbell.pbnj.api.v1.BMC/DeleteUser", + FullMethod: BMC_DeleteUser_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BMCServer).DeleteUser(ctx, req.(*DeleteUserRequest)) @@ -217,7 +232,7 @@ func _BMC_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/github.com.tinkerbell.pbnj.api.v1.BMC/UpdateUser", + FullMethod: BMC_UpdateUser_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BMCServer).UpdateUser(ctx, req.(*UpdateUserRequest)) @@ -235,7 +250,7 @@ func _BMC_DeactivateSOL_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/github.com.tinkerbell.pbnj.api.v1.BMC/DeactivateSOL", + FullMethod: BMC_DeactivateSOL_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BMCServer).DeactivateSOL(ctx, req.(*DeactivateSOLRequest)) @@ -243,7 +258,10 @@ func _BMC_DeactivateSOL_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } -var _BMC_serviceDesc = grpc.ServiceDesc{ +// BMC_ServiceDesc is the grpc.ServiceDesc for BMC service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var BMC_ServiceDesc = grpc.ServiceDesc{ ServiceName: "github.com.tinkerbell.pbnj.api.v1.BMC", HandlerType: (*BMCServer)(nil), Methods: []grpc.MethodDesc{ diff --git a/api/v1/common.pb.go b/api/v1/common.pb.go index 3765d04..be24ba3 100644 --- a/api/v1/common.pb.go +++ b/api/v1/common.pb.go @@ -1,17 +1,18 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v3.14.0 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: api/v1/common.proto package v1 import ( + reflect "reflect" + sync "sync" + _ "github.com/mwitkow/go-proto-validators" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( @@ -105,15 +106,16 @@ const ( // // Service implementors can use the following guidelines to decide // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: - // (a) Use `UNAVAILABLE` if the client can retry just the failing call. - // (b) Use `ABORTED` if the client should retry at a higher level - // (e.g., when a client-specified test-and-set fails, indicating the - // client should restart a read-modify-write sequence). - // (c) Use `FAILED_PRECONDITION` if the client should not retry until - // the system state has been explicitly fixed. E.g., if an "rmdir" - // fails because the directory is non-empty, `FAILED_PRECONDITION` - // should be returned since the client should not retry unless - // the files are deleted from the directory. + // + // (a) Use `UNAVAILABLE` if the client can retry just the failing call. + // (b) Use `ABORTED` if the client should retry at a higher level + // (e.g., when a client-specified test-and-set fails, indicating the + // client should restart a read-modify-write sequence). + // (c) Use `FAILED_PRECONDITION` if the client should not retry until + // the system state has been explicitly fixed. E.g., if an "rmdir" + // fails because the directory is non-empty, `FAILED_PRECONDITION` + // should be returned since the client should not retry unless + // the files are deleted from the directory. // // HTTP Mapping: 400 Bad Request Code_FAILED_PRECONDITION Code = 9 @@ -402,6 +404,7 @@ type Authn struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Authn: + // // *Authn_DirectAuthn Authn isAuthn_Authn `protobuf_oneof:"authn"` } diff --git a/api/v1/diagnostic.pb.go b/api/v1/diagnostic.pb.go index 6381885..24d5171 100644 --- a/api/v1/diagnostic.pb.go +++ b/api/v1/diagnostic.pb.go @@ -1,16 +1,18 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v3.14.0 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: api/v1/diagnostic.proto package v1 import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" ) const ( @@ -232,64 +234,123 @@ func (x *ClearSystemEventLogResponse) GetTaskId() string { return "" } +type SendNMIRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Authn *Authn `protobuf:"bytes,1,opt,name=authn,proto3" json:"authn,omitempty"` +} + +func (x *SendNMIRequest) Reset() { + *x = SendNMIRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v1_diagnostic_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendNMIRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendNMIRequest) ProtoMessage() {} + +func (x *SendNMIRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v1_diagnostic_proto_msgTypes[4] + 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 SendNMIRequest.ProtoReflect.Descriptor instead. +func (*SendNMIRequest) Descriptor() ([]byte, []int) { + return file_api_v1_diagnostic_proto_rawDescGZIP(), []int{4} +} + +func (x *SendNMIRequest) GetAuthn() *Authn { + if x != nil { + return x.Authn + } + return nil +} + var File_api_v1_diagnostic_proto protoreflect.FileDescriptor var file_api_v1_diagnostic_proto_rawDesc = []byte{ 0x0a, 0x17, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, - 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x13, 0x61, 0x70, - 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x96, 0x01, 0x0a, 0x11, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x73, 0x68, 0x6f, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x05, 0x61, 0x75, 0x74, 0x68, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, - 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6e, - 0x52, 0x05, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x12, 0x41, 0x0a, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, - 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x6e, 0x64, - 0x6f, 0x72, 0x52, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x22, 0x46, 0x0a, 0x12, 0x53, 0x63, - 0x72, 0x65, 0x65, 0x6e, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x74, 0x79, - 0x70, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x1a, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x79, 0x73, 0x74, - 0x65, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x3e, 0x0a, 0x05, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x28, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, - 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6e, 0x52, 0x05, 0x61, 0x75, 0x74, 0x68, - 0x6e, 0x12, 0x41, 0x0a, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, - 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x52, 0x06, 0x76, 0x65, - 0x6e, 0x64, 0x6f, 0x72, 0x22, 0x36, 0x0a, 0x1b, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x79, 0x73, - 0x74, 0x65, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x32, 0x9e, 0x02, 0x0a, - 0x0a, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x12, 0x79, 0x0a, 0x0a, 0x53, - 0x63, 0x72, 0x65, 0x65, 0x6e, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x34, 0x2e, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, - 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, - 0x72, 0x65, 0x65, 0x6e, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x35, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, - 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x94, 0x01, 0x0a, 0x13, 0x43, 0x6c, 0x65, 0x61, 0x72, - 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x12, 0x3d, + 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, + 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x96, + 0x01, 0x0a, 0x11, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x05, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6e, 0x52, 0x05, 0x61, + 0x75, 0x74, 0x68, 0x6e, 0x12, 0x41, 0x0a, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, + 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x52, + 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x22, 0x46, 0x0a, 0x12, 0x53, 0x63, 0x72, 0x65, 0x65, + 0x6e, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x74, 0x79, 0x70, 0x65, 0x22, + 0x9f, 0x01, 0x0a, 0x1a, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, + 0x0a, 0x05, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, + 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6e, 0x52, 0x05, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x12, 0x41, + 0x0a, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, + 0x76, 0x31, 0x2e, 0x56, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x52, 0x06, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x22, 0x36, 0x0a, 0x1b, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x50, 0x0a, 0x0e, 0x53, 0x65, 0x6e, + 0x64, 0x4e, 0x4d, 0x49, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x05, 0x61, + 0x75, 0x74, 0x68, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, + 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x75, 0x74, 0x68, 0x6e, 0x52, 0x05, 0x61, 0x75, 0x74, 0x68, 0x6e, 0x32, 0xf4, 0x02, 0x0a, 0x0a, + 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x12, 0x79, 0x0a, 0x0a, 0x53, 0x63, + 0x72, 0x65, 0x65, 0x6e, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x34, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, + 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x72, + 0x65, 0x65, 0x6e, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, + 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, + 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x94, 0x01, 0x0a, 0x13, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x12, 0x3d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x33, 0x5a, - 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x69, 0x6e, 0x6b, - 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2f, 0x70, 0x62, 0x6e, 0x6a, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x31, 0xea, 0x02, 0x0d, 0x50, 0x62, 0x6e, 0x6a, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, + 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x07, + 0x53, 0x65, 0x6e, 0x64, 0x4e, 0x4d, 0x49, 0x12, 0x31, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, + 0x70, 0x62, 0x6e, 0x6a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, + 0x4e, 0x4d, 0x49, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x42, 0x33, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2f, 0x70, 0x62, 0x6e, 0x6a, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0xea, 0x02, 0x0d, 0x50, 0x62, 0x6e, 0x6a, 0x3a, 0x3a, + 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -304,29 +365,34 @@ func file_api_v1_diagnostic_proto_rawDescGZIP() []byte { return file_api_v1_diagnostic_proto_rawDescData } -var file_api_v1_diagnostic_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_api_v1_diagnostic_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_api_v1_diagnostic_proto_goTypes = []interface{}{ (*ScreenshotRequest)(nil), // 0: github.com.tinkerbell.pbnj.api.v1.ScreenshotRequest (*ScreenshotResponse)(nil), // 1: github.com.tinkerbell.pbnj.api.v1.ScreenshotResponse (*ClearSystemEventLogRequest)(nil), // 2: github.com.tinkerbell.pbnj.api.v1.ClearSystemEventLogRequest (*ClearSystemEventLogResponse)(nil), // 3: github.com.tinkerbell.pbnj.api.v1.ClearSystemEventLogResponse - (*Authn)(nil), // 4: github.com.tinkerbell.pbnj.api.v1.Authn - (*Vendor)(nil), // 5: github.com.tinkerbell.pbnj.api.v1.Vendor + (*SendNMIRequest)(nil), // 4: github.com.tinkerbell.pbnj.api.v1.SendNMIRequest + (*Authn)(nil), // 5: github.com.tinkerbell.pbnj.api.v1.Authn + (*Vendor)(nil), // 6: github.com.tinkerbell.pbnj.api.v1.Vendor + (*emptypb.Empty)(nil), // 7: google.protobuf.Empty } var file_api_v1_diagnostic_proto_depIdxs = []int32{ - 4, // 0: github.com.tinkerbell.pbnj.api.v1.ScreenshotRequest.authn:type_name -> github.com.tinkerbell.pbnj.api.v1.Authn - 5, // 1: github.com.tinkerbell.pbnj.api.v1.ScreenshotRequest.vendor:type_name -> github.com.tinkerbell.pbnj.api.v1.Vendor - 4, // 2: github.com.tinkerbell.pbnj.api.v1.ClearSystemEventLogRequest.authn:type_name -> github.com.tinkerbell.pbnj.api.v1.Authn - 5, // 3: github.com.tinkerbell.pbnj.api.v1.ClearSystemEventLogRequest.vendor:type_name -> github.com.tinkerbell.pbnj.api.v1.Vendor - 0, // 4: github.com.tinkerbell.pbnj.api.v1.Diagnostic.Screenshot:input_type -> github.com.tinkerbell.pbnj.api.v1.ScreenshotRequest - 2, // 5: github.com.tinkerbell.pbnj.api.v1.Diagnostic.ClearSystemEventLog:input_type -> github.com.tinkerbell.pbnj.api.v1.ClearSystemEventLogRequest - 1, // 6: github.com.tinkerbell.pbnj.api.v1.Diagnostic.Screenshot:output_type -> github.com.tinkerbell.pbnj.api.v1.ScreenshotResponse - 3, // 7: github.com.tinkerbell.pbnj.api.v1.Diagnostic.ClearSystemEventLog:output_type -> github.com.tinkerbell.pbnj.api.v1.ClearSystemEventLogResponse - 6, // [6:8] is the sub-list for method output_type - 4, // [4:6] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 5, // 0: github.com.tinkerbell.pbnj.api.v1.ScreenshotRequest.authn:type_name -> github.com.tinkerbell.pbnj.api.v1.Authn + 6, // 1: github.com.tinkerbell.pbnj.api.v1.ScreenshotRequest.vendor:type_name -> github.com.tinkerbell.pbnj.api.v1.Vendor + 5, // 2: github.com.tinkerbell.pbnj.api.v1.ClearSystemEventLogRequest.authn:type_name -> github.com.tinkerbell.pbnj.api.v1.Authn + 6, // 3: github.com.tinkerbell.pbnj.api.v1.ClearSystemEventLogRequest.vendor:type_name -> github.com.tinkerbell.pbnj.api.v1.Vendor + 5, // 4: github.com.tinkerbell.pbnj.api.v1.SendNMIRequest.authn:type_name -> github.com.tinkerbell.pbnj.api.v1.Authn + 0, // 5: github.com.tinkerbell.pbnj.api.v1.Diagnostic.Screenshot:input_type -> github.com.tinkerbell.pbnj.api.v1.ScreenshotRequest + 2, // 6: github.com.tinkerbell.pbnj.api.v1.Diagnostic.ClearSystemEventLog:input_type -> github.com.tinkerbell.pbnj.api.v1.ClearSystemEventLogRequest + 4, // 7: github.com.tinkerbell.pbnj.api.v1.Diagnostic.SendNMI:input_type -> github.com.tinkerbell.pbnj.api.v1.SendNMIRequest + 1, // 8: github.com.tinkerbell.pbnj.api.v1.Diagnostic.Screenshot:output_type -> github.com.tinkerbell.pbnj.api.v1.ScreenshotResponse + 3, // 9: github.com.tinkerbell.pbnj.api.v1.Diagnostic.ClearSystemEventLog:output_type -> github.com.tinkerbell.pbnj.api.v1.ClearSystemEventLogResponse + 7, // 10: github.com.tinkerbell.pbnj.api.v1.Diagnostic.SendNMI:output_type -> google.protobuf.Empty + 8, // [8:11] is the sub-list for method output_type + 5, // [5:8] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_api_v1_diagnostic_proto_init() } @@ -384,6 +450,18 @@ func file_api_v1_diagnostic_proto_init() { return nil } } + file_api_v1_diagnostic_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendNMIRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -391,7 +469,7 @@ func file_api_v1_diagnostic_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_v1_diagnostic_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 1, }, diff --git a/api/v1/diagnostic.proto b/api/v1/diagnostic.proto index 1120cdf..a13d371 100644 --- a/api/v1/diagnostic.proto +++ b/api/v1/diagnostic.proto @@ -1,5 +1,7 @@ syntax = "proto3"; +import "google/protobuf/empty.proto"; + option go_package = "github.com/tinkerbell/pbnj/api/v1"; option ruby_package = "Pbnj::Api::V1"; @@ -10,6 +12,7 @@ import "api/v1/common.proto"; service Diagnostic { rpc Screenshot (ScreenshotRequest) returns (ScreenshotResponse); rpc ClearSystemEventLog (ClearSystemEventLogRequest) returns (ClearSystemEventLogResponse); + rpc SendNMI (SendNMIRequest) returns (google.protobuf.Empty); } message ScreenshotRequest { @@ -29,4 +32,8 @@ message ClearSystemEventLogRequest { message ClearSystemEventLogResponse { string task_id = 1; -} \ No newline at end of file +} + +message SendNMIRequest { + v1.Authn authn = 1; +} diff --git a/api/v1/diagnostic.validator.pb.go b/api/v1/diagnostic.validator.pb.go index 7b56591..8fdb97f 100644 --- a/api/v1/diagnostic.validator.pb.go +++ b/api/v1/diagnostic.validator.pb.go @@ -9,6 +9,7 @@ import ( proto "github.com/golang/protobuf/proto" github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" + _ "google.golang.org/protobuf/types/known/emptypb" ) // Reference imports to suppress errors if they are not otherwise used. @@ -48,3 +49,11 @@ func (this *ClearSystemEventLogRequest) Validate() error { func (this *ClearSystemEventLogResponse) Validate() error { return nil } +func (this *SendNMIRequest) Validate() error { + if this.Authn != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Authn); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Authn", err) + } + } + return nil +} diff --git a/api/v1/diagnostic_grpc.pb.go b/api/v1/diagnostic_grpc.pb.go index 603ab41..974f9b9 100644 --- a/api/v1/diagnostic_grpc.pb.go +++ b/api/v1/diagnostic_grpc.pb.go @@ -1,24 +1,38 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: api/v1/diagnostic.proto package v1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Diagnostic_Screenshot_FullMethodName = "/github.com.tinkerbell.pbnj.api.v1.Diagnostic/Screenshot" + Diagnostic_ClearSystemEventLog_FullMethodName = "/github.com.tinkerbell.pbnj.api.v1.Diagnostic/ClearSystemEventLog" + Diagnostic_SendNMI_FullMethodName = "/github.com.tinkerbell.pbnj.api.v1.Diagnostic/SendNMI" +) + // DiagnosticClient is the client API for Diagnostic service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type DiagnosticClient interface { Screenshot(ctx context.Context, in *ScreenshotRequest, opts ...grpc.CallOption) (*ScreenshotResponse, error) ClearSystemEventLog(ctx context.Context, in *ClearSystemEventLogRequest, opts ...grpc.CallOption) (*ClearSystemEventLogResponse, error) + SendNMI(ctx context.Context, in *SendNMIRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } type diagnosticClient struct { @@ -31,7 +45,7 @@ func NewDiagnosticClient(cc grpc.ClientConnInterface) DiagnosticClient { func (c *diagnosticClient) Screenshot(ctx context.Context, in *ScreenshotRequest, opts ...grpc.CallOption) (*ScreenshotResponse, error) { out := new(ScreenshotResponse) - err := c.cc.Invoke(ctx, "/github.com.tinkerbell.pbnj.api.v1.Diagnostic/Screenshot", in, out, opts...) + err := c.cc.Invoke(ctx, Diagnostic_Screenshot_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -40,7 +54,16 @@ func (c *diagnosticClient) Screenshot(ctx context.Context, in *ScreenshotRequest func (c *diagnosticClient) ClearSystemEventLog(ctx context.Context, in *ClearSystemEventLogRequest, opts ...grpc.CallOption) (*ClearSystemEventLogResponse, error) { out := new(ClearSystemEventLogResponse) - err := c.cc.Invoke(ctx, "/github.com.tinkerbell.pbnj.api.v1.Diagnostic/ClearSystemEventLog", in, out, opts...) + err := c.cc.Invoke(ctx, Diagnostic_ClearSystemEventLog_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *diagnosticClient) SendNMI(ctx context.Context, in *SendNMIRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Diagnostic_SendNMI_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -53,6 +76,7 @@ func (c *diagnosticClient) ClearSystemEventLog(ctx context.Context, in *ClearSys type DiagnosticServer interface { Screenshot(context.Context, *ScreenshotRequest) (*ScreenshotResponse, error) ClearSystemEventLog(context.Context, *ClearSystemEventLogRequest) (*ClearSystemEventLogResponse, error) + SendNMI(context.Context, *SendNMIRequest) (*emptypb.Empty, error) mustEmbedUnimplementedDiagnosticServer() } @@ -66,6 +90,9 @@ func (UnimplementedDiagnosticServer) Screenshot(context.Context, *ScreenshotRequ func (UnimplementedDiagnosticServer) ClearSystemEventLog(context.Context, *ClearSystemEventLogRequest) (*ClearSystemEventLogResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ClearSystemEventLog not implemented") } +func (UnimplementedDiagnosticServer) SendNMI(context.Context, *SendNMIRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendNMI not implemented") +} func (UnimplementedDiagnosticServer) mustEmbedUnimplementedDiagnosticServer() {} // UnsafeDiagnosticServer may be embedded to opt out of forward compatibility for this service. @@ -76,7 +103,7 @@ type UnsafeDiagnosticServer interface { } func RegisterDiagnosticServer(s grpc.ServiceRegistrar, srv DiagnosticServer) { - s.RegisterService(&_Diagnostic_serviceDesc, srv) + s.RegisterService(&Diagnostic_ServiceDesc, srv) } func _Diagnostic_Screenshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -89,7 +116,7 @@ func _Diagnostic_Screenshot_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/github.com.tinkerbell.pbnj.api.v1.Diagnostic/Screenshot", + FullMethod: Diagnostic_Screenshot_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DiagnosticServer).Screenshot(ctx, req.(*ScreenshotRequest)) @@ -107,7 +134,7 @@ func _Diagnostic_ClearSystemEventLog_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/github.com.tinkerbell.pbnj.api.v1.Diagnostic/ClearSystemEventLog", + FullMethod: Diagnostic_ClearSystemEventLog_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DiagnosticServer).ClearSystemEventLog(ctx, req.(*ClearSystemEventLogRequest)) @@ -115,7 +142,28 @@ func _Diagnostic_ClearSystemEventLog_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } -var _Diagnostic_serviceDesc = grpc.ServiceDesc{ +func _Diagnostic_SendNMI_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendNMIRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DiagnosticServer).SendNMI(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Diagnostic_SendNMI_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DiagnosticServer).SendNMI(ctx, req.(*SendNMIRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Diagnostic_ServiceDesc is the grpc.ServiceDesc for Diagnostic service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Diagnostic_ServiceDesc = grpc.ServiceDesc{ ServiceName: "github.com.tinkerbell.pbnj.api.v1.Diagnostic", HandlerType: (*DiagnosticServer)(nil), Methods: []grpc.MethodDesc{ @@ -127,6 +175,10 @@ var _Diagnostic_serviceDesc = grpc.ServiceDesc{ MethodName: "ClearSystemEventLog", Handler: _Diagnostic_ClearSystemEventLog_Handler, }, + { + MethodName: "SendNMI", + Handler: _Diagnostic_SendNMI_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/v1/diagnostic.proto", diff --git a/api/v1/machine.pb.go b/api/v1/machine.pb.go index 22c89ae..1eb383b 100644 --- a/api/v1/machine.pb.go +++ b/api/v1/machine.pb.go @@ -1,17 +1,18 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v3.14.0 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: api/v1/machine.proto package v1 import ( + reflect "reflect" + sync "sync" + _ "github.com/mwitkow/go-proto-validators" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/api/v1/machine_grpc.pb.go b/api/v1/machine_grpc.pb.go index 9c41bf6..f237d45 100644 --- a/api/v1/machine_grpc.pb.go +++ b/api/v1/machine_grpc.pb.go @@ -1,9 +1,14 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: api/v1/machine.proto package v1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -11,8 +16,14 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Machine_BootDevice_FullMethodName = "/github.com.tinkerbell.pbnj.api.v1.Machine/BootDevice" + Machine_Power_FullMethodName = "/github.com.tinkerbell.pbnj.api.v1.Machine/Power" +) + // MachineClient is the client API for Machine service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -31,7 +42,7 @@ func NewMachineClient(cc grpc.ClientConnInterface) MachineClient { func (c *machineClient) BootDevice(ctx context.Context, in *DeviceRequest, opts ...grpc.CallOption) (*DeviceResponse, error) { out := new(DeviceResponse) - err := c.cc.Invoke(ctx, "/github.com.tinkerbell.pbnj.api.v1.Machine/BootDevice", in, out, opts...) + err := c.cc.Invoke(ctx, Machine_BootDevice_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -40,7 +51,7 @@ func (c *machineClient) BootDevice(ctx context.Context, in *DeviceRequest, opts func (c *machineClient) Power(ctx context.Context, in *PowerRequest, opts ...grpc.CallOption) (*PowerResponse, error) { out := new(PowerResponse) - err := c.cc.Invoke(ctx, "/github.com.tinkerbell.pbnj.api.v1.Machine/Power", in, out, opts...) + err := c.cc.Invoke(ctx, Machine_Power_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -76,7 +87,7 @@ type UnsafeMachineServer interface { } func RegisterMachineServer(s grpc.ServiceRegistrar, srv MachineServer) { - s.RegisterService(&_Machine_serviceDesc, srv) + s.RegisterService(&Machine_ServiceDesc, srv) } func _Machine_BootDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -89,7 +100,7 @@ func _Machine_BootDevice_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/github.com.tinkerbell.pbnj.api.v1.Machine/BootDevice", + FullMethod: Machine_BootDevice_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MachineServer).BootDevice(ctx, req.(*DeviceRequest)) @@ -107,7 +118,7 @@ func _Machine_Power_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/github.com.tinkerbell.pbnj.api.v1.Machine/Power", + FullMethod: Machine_Power_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MachineServer).Power(ctx, req.(*PowerRequest)) @@ -115,7 +126,10 @@ func _Machine_Power_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -var _Machine_serviceDesc = grpc.ServiceDesc{ +// Machine_ServiceDesc is the grpc.ServiceDesc for Machine service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Machine_ServiceDesc = grpc.ServiceDesc{ ServiceName: "github.com.tinkerbell.pbnj.api.v1.Machine", HandlerType: (*MachineServer)(nil), Methods: []grpc.MethodDesc{ diff --git a/api/v1/task.pb.go b/api/v1/task.pb.go index c6341b1..6742773 100644 --- a/api/v1/task.pb.go +++ b/api/v1/task.pb.go @@ -1,17 +1,18 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v3.14.0 +// protoc-gen-go v1.33.0 +// protoc v4.25.3 // source: api/v1/task.proto package v1 import ( + reflect "reflect" + sync "sync" + _ "github.com/mwitkow/go-proto-validators" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/api/v1/task_grpc.pb.go b/api/v1/task_grpc.pb.go index c5967dd..f6b8d45 100644 --- a/api/v1/task_grpc.pb.go +++ b/api/v1/task_grpc.pb.go @@ -1,9 +1,14 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: api/v1/task.proto package v1 import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -11,8 +16,13 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Task_Status_FullMethodName = "/github.com.tinkerbell.pbnj.api.v1.Task/Status" +) + // TaskClient is the client API for Task service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -30,7 +40,7 @@ func NewTaskClient(cc grpc.ClientConnInterface) TaskClient { func (c *taskClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { out := new(StatusResponse) - err := c.cc.Invoke(ctx, "/github.com.tinkerbell.pbnj.api.v1.Task/Status", in, out, opts...) + err := c.cc.Invoke(ctx, Task_Status_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -62,7 +72,7 @@ type UnsafeTaskServer interface { } func RegisterTaskServer(s grpc.ServiceRegistrar, srv TaskServer) { - s.RegisterService(&_Task_serviceDesc, srv) + s.RegisterService(&Task_ServiceDesc, srv) } func _Task_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -75,7 +85,7 @@ func _Task_Status_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/github.com.tinkerbell.pbnj.api.v1.Task/Status", + FullMethod: Task_Status_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TaskServer).Status(ctx, req.(*StatusRequest)) @@ -83,7 +93,10 @@ func _Task_Status_Handler(srv interface{}, ctx context.Context, dec func(interfa return interceptor(ctx, in, info, handler) } -var _Task_serviceDesc = grpc.ServiceDesc{ +// Task_ServiceDesc is the grpc.ServiceDesc for Task service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Task_ServiceDesc = grpc.ServiceDesc{ ServiceName: "github.com.tinkerbell.pbnj.api.v1.Task", HandlerType: (*TaskServer)(nil), Methods: []grpc.MethodDesc{ diff --git a/client/client.go b/client/client.go index 7ef2b06..e53b9a2 100644 --- a/client/client.go +++ b/client/client.go @@ -145,3 +145,9 @@ func ClearSystemEventLog(ctx context.Context, client v1.DiagnosticClient, taskCl } return statusResp, nil } + +// SendNMI will tell the BMC to send an NMI to the server. +func SendNMI(ctx context.Context, client v1.DiagnosticClient, request *v1.SendNMIRequest) error { + _, err := client.SendNMI(ctx, request) + return err +} diff --git a/cmd/nmi.go b/cmd/nmi.go new file mode 100644 index 0000000..6cfc20a --- /dev/null +++ b/cmd/nmi.go @@ -0,0 +1,57 @@ +package cmd + +import ( + "context" + "os" + + "github.com/spf13/cobra" + v1 "github.com/tinkerbell/pbnj/api/v1" + v1Client "github.com/tinkerbell/pbnj/client" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" +) + +var ( + sendNMICmd = &cobra.Command{ + Use: "nmi", + Short: "Send NMI", + Long: `Tell the target BMC to send an NMI to the system`, + Run: func(cmd *cobra.Command, args []string) { + var opts []grpc.DialOption + ctx := context.Background() + + logger := defaultLogger(logLevel) + + opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.Dial("localhost:"+port, opts...) + if err != nil { + logger.Error(err, "fail to dial server") + os.Exit(1) + } + defer conn.Close() + client := v1.NewDiagnosticClient(conn) + + err = v1Client.SendNMI(ctx, client, &v1.SendNMIRequest{ + Authn: &v1.Authn{ + Authn: &v1.Authn_DirectAuthn{ + DirectAuthn: &v1.DirectAuthn{ + Host: &v1.Host{ + Host: bmcaddress, + }, + Username: bmcuser, + Password: bmcpass, + }, + }, + }, + }) + if err != nil { + logger.Error(err, "error calling") + os.Exit(1) + } + }, + } +) + +func init() { + diagnosticCmd.AddCommand(sendNMICmd) +} diff --git a/go.mod b/go.mod index b3bd57d..b5f27fe 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/bmc-toolbox/bmclib v0.5.7 - github.com/bmc-toolbox/bmclib/v2 v2.2.1 + github.com/bmc-toolbox/bmclib/v2 v2.2.3 github.com/cristalhq/jwt/v3 v3.1.0 github.com/equinix-labs/otel-init-go v0.0.7 github.com/fatih/color v1.15.0 diff --git a/go.sum b/go.sum index 58c5898..3e56cdc 100644 --- a/go.sum +++ b/go.sum @@ -56,8 +56,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bmc-toolbox/bmclib v0.5.7 h1:v3CqOJCMUuH+kA+xi7CdY5EuzUhMH9gsBkYTQMYlbog= github.com/bmc-toolbox/bmclib v0.5.7/go.mod h1:jSCb2/o2bZhTTg3IgShckCfFxkX4yqQC065tuYh2pKk= -github.com/bmc-toolbox/bmclib/v2 v2.2.1 h1:Y9msRLtHUB5mOgG1Dey1JxBJTIvJCoffcRHrBt7P7Fc= -github.com/bmc-toolbox/bmclib/v2 v2.2.1/go.mod h1:gFF4iD468hbW1JUdJJx3mbhNGzoLsG47epbMa++grp8= +github.com/bmc-toolbox/bmclib/v2 v2.2.3 h1:8IqAPtGXY7vfmSJm0ZYlQ4IOP9hKb33iTyQUbW1XyaE= +github.com/bmc-toolbox/bmclib/v2 v2.2.3/go.mod h1:gFF4iD468hbW1JUdJJx3mbhNGzoLsG47epbMa++grp8= github.com/bmc-toolbox/common v0.0.0-20231204194243-7bcbccab7116 h1:gqWn/cMjryKoUfITx2vRHrRHTvd9fQ+zKPwWsmMIrK4= github.com/bmc-toolbox/common v0.0.0-20231204194243-7bcbccab7116/go.mod h1:SY//n1PJjZfbFbmAsB6GvEKbc7UXz3d30s3kWxfJQ/c= github.com/bombsimon/logrusr/v2 v2.0.1 h1:1VgxVNQMCvjirZIYaT9JYn6sAVGVEcNtRE0y4mvaOAM= diff --git a/grpc/oob/diagnostic/diagnostic.go b/grpc/oob/diagnostic/diagnostic.go index 59846e3..3ee19d6 100644 --- a/grpc/oob/diagnostic/diagnostic.go +++ b/grpc/oob/diagnostic/diagnostic.go @@ -10,6 +10,7 @@ type Action struct { common.Accessory ScreenshotRequest *v1.ScreenshotRequest ClearSystemEventLogRequest *v1.ClearSystemEventLogRequest + SendNMIRequest *v1.SendNMIRequest } // WithLogger adds a logr to an Action struct. diff --git a/grpc/oob/diagnostic/nmi.go b/grpc/oob/diagnostic/nmi.go new file mode 100644 index 0000000..dc24ad8 --- /dev/null +++ b/grpc/oob/diagnostic/nmi.go @@ -0,0 +1,101 @@ +package diagnostic + +import ( + "context" + "fmt" + + "github.com/bmc-toolbox/bmclib/v2" + "github.com/prometheus/client_golang/prometheus" + v1 "github.com/tinkerbell/pbnj/api/v1" + common "github.com/tinkerbell/pbnj/grpc/oob" + "github.com/tinkerbell/pbnj/pkg/metrics" + "github.com/tinkerbell/pbnj/pkg/repository" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace" +) + +func NewNMISender(req *v1.SendNMIRequest, opts ...Option) (*Action, error) { + a := &Action{} + a.SendNMIRequest = req + for _, opt := range opts { + err := opt(a) + if err != nil { + return nil, err + } + } + return a, nil +} + +func (m Action) SendNMI(ctx context.Context) error { + labels := prometheus.Labels{ + "service": "diagnostic", + "action": "send_nmi", + } + + timer := prometheus.NewTimer(metrics.ActionDuration.With(labels)) + defer timer.ObserveDuration() + + tracer := otel.Tracer("pbnj") + ctx, span := tracer.Start(ctx, "diagnostic.SendNMI", trace.WithAttributes( + attribute.String("bmc.device", m.SendNMIRequest.GetAuthn().GetDirectAuthn().GetHost().GetHost()), + )) + defer span.End() + + host, user, password, parseErr := m.ParseAuth(m.SendNMIRequest.GetAuthn()) + if parseErr != nil { + span.SetStatus(codes.Error, "error parsing credentials: "+parseErr.Error()) + return parseErr + } + span.SetAttributes(attribute.String("bmc.host", host), attribute.String("bmc.username", user)) + + opts := []bmclib.Option{ + bmclib.WithLogger(m.Log), + bmclib.WithPerProviderTimeout(common.BMCTimeoutFromCtx(ctx)), + } + + client := bmclib.NewClient(host, user, password, opts...) + + m.SendStatusMessage("connecting to BMC") + err := client.Open(ctx) + meta := client.GetMetadata() + span.SetAttributes(attribute.StringSlice("bmc.open.providersAttempted", meta.ProvidersAttempted), + attribute.StringSlice("bmc.open.successfulOpenConns", meta.SuccessfulOpenConns)) + if err != nil { + span.SetStatus(codes.Error, err.Error()) + return &repository.Error{ + Code: v1.Code_value["PERMISSION_DENIED"], + Message: err.Error(), + } + } + log := m.Log.WithValues("host", host, "user", user) + defer func() { + _ = client.Close(ctx) + log.Info("closed connections", logMetadata(client.GetMetadata())...) + }() + log.Info("connected to BMC", logMetadata(client.GetMetadata())...) + m.SendStatusMessage("connected to BMC") + + err = client.SendNMI(ctx) + log = m.Log.WithValues(logMetadata(client.GetMetadata())...) + meta = client.GetMetadata() + span.SetAttributes(attribute.String("bmc.send_nmi.successfulProvider", meta.SuccessfulProvider), + attribute.StringSlice("bmc.send_nmi.ProvidersAttempted", meta.ProvidersAttempted)) + if err != nil { + log.Error(err, "error sending NMI") + span.SetStatus(codes.Error, "error sending NMI: "+err.Error()) + m.SendStatusMessage(fmt.Sprintf("failed to send NMI %v", host)) + + return &repository.Error{ + Code: v1.Code_value["UNKNOWN"], + Message: err.Error(), + } + } + + span.SetStatus(codes.Ok, "") + log.Info("NMI sent", logMetadata(client.GetMetadata())...) + m.SendStatusMessage(fmt.Sprintf("Send NMI to host %v", host)) + + return nil +} diff --git a/grpc/rpc/diagnostic.go b/grpc/rpc/diagnostic.go index bf4c001..9d6f595 100644 --- a/grpc/rpc/diagnostic.go +++ b/grpc/rpc/diagnostic.go @@ -10,6 +10,7 @@ import ( "github.com/tinkerbell/pbnj/pkg/logging" "github.com/tinkerbell/pbnj/pkg/task" "go.opentelemetry.io/otel/trace" + "google.golang.org/protobuf/types/known/emptypb" ) type DiagnosticService struct { @@ -79,3 +80,30 @@ func (d *DiagnosticService) ClearSystemEventLog(ctx context.Context, in *v1.Clea return &v1.ClearSystemEventLogResponse{TaskId: taskID}, nil } + +func (d *DiagnosticService) SendNMI(ctx context.Context, in *v1.SendNMIRequest) (*emptypb.Empty, error) { + empty := &emptypb.Empty{} + l := logging.ExtractLogr(ctx) + taskID := xid.New().String() + l = l.WithValues("taskID", taskID) + + l.Info( + "start Send NMI request", + "username", in.Authn.GetDirectAuthn().GetUsername(), + "host", in.Authn.GetDirectAuthn().GetHost(), + ) + + action, err := diagnostic.NewNMISender(in, diagnostic.WithLogger(l)) + if err != nil { + l.Error(err, "error creating NMI sender") + return empty, err + } + + err = action.SendNMI(ctx) + if err != nil { + l.Error(err, "error sending NMI") + return empty, err + } + + return empty, nil +}