From ed33c6abc14d1a92bc0a76b54f9bb89917fbafe4 Mon Sep 17 00:00:00 2001 From: Sean Breen Date: Fri, 7 Nov 2025 10:50:45 +0000 Subject: [PATCH 1/7] [skip ci] adding Log configuration option to MPI --- api/grpc/mpi/v1/command.pb.go | 732 ++++++++++++------ api/grpc/mpi/v1/command.pb.validate.go | 469 +++++++++++ api/grpc/mpi/v1/command.proto | 34 + docs/proto/protos.md | 68 ++ internal/bus/topics.go | 1 + internal/command/command_plugin.go | 32 + internal/command/command_plugin_test.go | 11 + internal/command/command_service.go | 26 + internal/command/command_service_test.go | 33 + .../commandfakes/fake_command_service.go | 76 ++ internal/config/config_test.go | 4 +- internal/config/mapper.go | 46 ++ internal/config/mapper_test.go | 114 ++- test/protos/management_plane_request.go | 11 + 14 files changed, 1421 insertions(+), 236 deletions(-) diff --git a/api/grpc/mpi/v1/command.pb.go b/api/grpc/mpi/v1/command.pb.go index 31e94ea7d..d135f09f6 100644 --- a/api/grpc/mpi/v1/command.pb.go +++ b/api/grpc/mpi/v1/command.pb.go @@ -85,7 +85,7 @@ func (x InstanceHealth_InstanceHealthStatus) Number() protoreflect.EnumNumber { // Deprecated: Use InstanceHealth_InstanceHealthStatus.Descriptor instead. func (InstanceHealth_InstanceHealthStatus) EnumDescriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{8, 0} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{10, 0} } // the types of instances possible @@ -150,7 +150,67 @@ func (x InstanceMeta_InstanceType) Number() protoreflect.EnumNumber { // Deprecated: Use InstanceMeta_InstanceType.Descriptor instead. func (InstanceMeta_InstanceType) EnumDescriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{26, 0} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{28, 0} +} + +type Log_LogLevel int32 + +const ( + // Unspecified log level + Log_LOG_LEVEL_UNSPECIFIED Log_LogLevel = 0 + // Error log level + Log_LOG_LEVEL_ERROR Log_LogLevel = 1 + // Warning log level + Log_LOG_LEVEL_WARN Log_LogLevel = 2 + // Info log level + Log_LOG_LEVEL_INFO Log_LogLevel = 3 + // Debug log level + Log_LOG_LEVEL_DEBUG Log_LogLevel = 4 +) + +// Enum value maps for Log_LogLevel. +var ( + Log_LogLevel_name = map[int32]string{ + 0: "LOG_LEVEL_UNSPECIFIED", + 1: "LOG_LEVEL_ERROR", + 2: "LOG_LEVEL_WARN", + 3: "LOG_LEVEL_INFO", + 4: "LOG_LEVEL_DEBUG", + } + Log_LogLevel_value = map[string]int32{ + "LOG_LEVEL_UNSPECIFIED": 0, + "LOG_LEVEL_ERROR": 1, + "LOG_LEVEL_WARN": 2, + "LOG_LEVEL_INFO": 3, + "LOG_LEVEL_DEBUG": 4, + } +) + +func (x Log_LogLevel) Enum() *Log_LogLevel { + p := new(Log_LogLevel) + *p = x + return p +} + +func (x Log_LogLevel) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Log_LogLevel) Descriptor() protoreflect.EnumDescriptor { + return file_mpi_v1_command_proto_enumTypes[2].Descriptor() +} + +func (Log_LogLevel) Type() protoreflect.EnumType { + return &file_mpi_v1_command_proto_enumTypes[2] +} + +func (x Log_LogLevel) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Log_LogLevel.Descriptor instead. +func (Log_LogLevel) EnumDescriptor() ([]byte, []int) { + return file_mpi_v1_command_proto_rawDescGZIP(), []int{38, 0} } // The connection request is an initial handshake to establish a connection, sending NGINX Agent instance information @@ -670,6 +730,105 @@ func (*UpdateDataPlaneStatusResponse) Descriptor() ([]byte, []int) { return file_mpi_v1_command_proto_rawDescGZIP(), []int{7} } +type UpdateNginxAgentConfigurationRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Meta-information associated with a message + MessageMeta *MessageMeta `protobuf:"bytes,1,opt,name=message_meta,json=messageMeta,proto3" json:"message_meta,omitempty"` + // the NGINX Agent configuration to update + AgentConfig *AgentConfig `protobuf:"bytes,2,opt,name=agent_config,json=agentConfig,proto3" json:"agent_config,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateNginxAgentConfigurationRequest) Reset() { + *x = UpdateNginxAgentConfigurationRequest{} + mi := &file_mpi_v1_command_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateNginxAgentConfigurationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateNginxAgentConfigurationRequest) ProtoMessage() {} + +func (x *UpdateNginxAgentConfigurationRequest) ProtoReflect() protoreflect.Message { + mi := &file_mpi_v1_command_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateNginxAgentConfigurationRequest.ProtoReflect.Descriptor instead. +func (*UpdateNginxAgentConfigurationRequest) Descriptor() ([]byte, []int) { + return file_mpi_v1_command_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateNginxAgentConfigurationRequest) GetMessageMeta() *MessageMeta { + if x != nil { + return x.MessageMeta + } + return nil +} + +func (x *UpdateNginxAgentConfigurationRequest) GetAgentConfig() *AgentConfig { + if x != nil { + return x.AgentConfig + } + return nil +} + +type UpdateNginxAgentConfigurationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The success or failure of the UpdateNginxAgentConfigurationRequest + Response *CommandResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateNginxAgentConfigurationResponse) Reset() { + *x = UpdateNginxAgentConfigurationResponse{} + mi := &file_mpi_v1_command_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateNginxAgentConfigurationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateNginxAgentConfigurationResponse) ProtoMessage() {} + +func (x *UpdateNginxAgentConfigurationResponse) ProtoReflect() protoreflect.Message { + mi := &file_mpi_v1_command_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateNginxAgentConfigurationResponse.ProtoReflect.Descriptor instead. +func (*UpdateNginxAgentConfigurationResponse) Descriptor() ([]byte, []int) { + return file_mpi_v1_command_proto_rawDescGZIP(), []int{9} +} + +func (x *UpdateNginxAgentConfigurationResponse) GetResponse() *CommandResponse { + if x != nil { + return x.Response + } + return nil +} + type InstanceHealth struct { state protoimpl.MessageState `protogen:"open.v1"` InstanceId string `protobuf:"bytes,1,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` @@ -683,7 +842,7 @@ type InstanceHealth struct { func (x *InstanceHealth) Reset() { *x = InstanceHealth{} - mi := &file_mpi_v1_command_proto_msgTypes[8] + mi := &file_mpi_v1_command_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -695,7 +854,7 @@ func (x *InstanceHealth) String() string { func (*InstanceHealth) ProtoMessage() {} func (x *InstanceHealth) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[8] + mi := &file_mpi_v1_command_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -708,7 +867,7 @@ func (x *InstanceHealth) ProtoReflect() protoreflect.Message { // Deprecated: Use InstanceHealth.ProtoReflect.Descriptor instead. func (*InstanceHealth) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{8} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{10} } func (x *InstanceHealth) GetInstanceId() string { @@ -745,7 +904,7 @@ type UpdateDataPlaneHealthRequest struct { func (x *UpdateDataPlaneHealthRequest) Reset() { *x = UpdateDataPlaneHealthRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[9] + mi := &file_mpi_v1_command_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -757,7 +916,7 @@ func (x *UpdateDataPlaneHealthRequest) String() string { func (*UpdateDataPlaneHealthRequest) ProtoMessage() {} func (x *UpdateDataPlaneHealthRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[9] + mi := &file_mpi_v1_command_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -770,7 +929,7 @@ func (x *UpdateDataPlaneHealthRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateDataPlaneHealthRequest.ProtoReflect.Descriptor instead. func (*UpdateDataPlaneHealthRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{9} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{11} } func (x *UpdateDataPlaneHealthRequest) GetMessageMeta() *MessageMeta { @@ -796,7 +955,7 @@ type UpdateDataPlaneHealthResponse struct { func (x *UpdateDataPlaneHealthResponse) Reset() { *x = UpdateDataPlaneHealthResponse{} - mi := &file_mpi_v1_command_proto_msgTypes[10] + mi := &file_mpi_v1_command_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -808,7 +967,7 @@ func (x *UpdateDataPlaneHealthResponse) String() string { func (*UpdateDataPlaneHealthResponse) ProtoMessage() {} func (x *UpdateDataPlaneHealthResponse) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[10] + mi := &file_mpi_v1_command_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -821,7 +980,7 @@ func (x *UpdateDataPlaneHealthResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateDataPlaneHealthResponse.ProtoReflect.Descriptor instead. func (*UpdateDataPlaneHealthResponse) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{10} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{12} } // Reports the status of an associated command. This may be in response to a ManagementPlaneRequest @@ -839,7 +998,7 @@ type DataPlaneResponse struct { func (x *DataPlaneResponse) Reset() { *x = DataPlaneResponse{} - mi := &file_mpi_v1_command_proto_msgTypes[11] + mi := &file_mpi_v1_command_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -851,7 +1010,7 @@ func (x *DataPlaneResponse) String() string { func (*DataPlaneResponse) ProtoMessage() {} func (x *DataPlaneResponse) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[11] + mi := &file_mpi_v1_command_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -864,7 +1023,7 @@ func (x *DataPlaneResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DataPlaneResponse.ProtoReflect.Descriptor instead. func (*DataPlaneResponse) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{11} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{13} } func (x *DataPlaneResponse) GetMessageMeta() *MessageMeta { @@ -901,6 +1060,7 @@ type ManagementPlaneRequest struct { // *ManagementPlaneRequest_ConfigUploadRequest // *ManagementPlaneRequest_ActionRequest // *ManagementPlaneRequest_CommandStatusRequest + // *ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest Request isManagementPlaneRequest_Request `protobuf_oneof:"request"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -908,7 +1068,7 @@ type ManagementPlaneRequest struct { func (x *ManagementPlaneRequest) Reset() { *x = ManagementPlaneRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[12] + mi := &file_mpi_v1_command_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -920,7 +1080,7 @@ func (x *ManagementPlaneRequest) String() string { func (*ManagementPlaneRequest) ProtoMessage() {} func (x *ManagementPlaneRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[12] + mi := &file_mpi_v1_command_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -933,7 +1093,7 @@ func (x *ManagementPlaneRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ManagementPlaneRequest.ProtoReflect.Descriptor instead. func (*ManagementPlaneRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{12} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{14} } func (x *ManagementPlaneRequest) GetMessageMeta() *MessageMeta { @@ -1004,6 +1164,15 @@ func (x *ManagementPlaneRequest) GetCommandStatusRequest() *CommandStatusRequest return nil } +func (x *ManagementPlaneRequest) GetUpdateNginxAgentConfigurationRequest() *UpdateNginxAgentConfigurationRequest { + if x != nil { + if x, ok := x.Request.(*ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest); ok { + return x.UpdateNginxAgentConfigurationRequest + } + } + return nil +} + type isManagementPlaneRequest_Request interface { isManagementPlaneRequest_Request() } @@ -1039,6 +1208,11 @@ type ManagementPlaneRequest_CommandStatusRequest struct { CommandStatusRequest *CommandStatusRequest `protobuf:"bytes,8,opt,name=command_status_request,json=commandStatusRequest,proto3,oneof"` } +type ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest struct { + // triggers an UpdateNginxAgentConfiguration rpc, returning an UpdateNginxAgentConfigurationResponse + UpdateNginxAgentConfigurationRequest *UpdateNginxAgentConfigurationRequest `protobuf:"bytes,9,opt,name=update_nginx_agent_configuration_request,json=updateNginxAgentConfigurationRequest,proto3,oneof"` +} + func (*ManagementPlaneRequest_StatusRequest) isManagementPlaneRequest_Request() {} func (*ManagementPlaneRequest_HealthRequest) isManagementPlaneRequest_Request() {} @@ -1051,6 +1225,9 @@ func (*ManagementPlaneRequest_ActionRequest) isManagementPlaneRequest_Request() func (*ManagementPlaneRequest_CommandStatusRequest) isManagementPlaneRequest_Request() {} +func (*ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest) isManagementPlaneRequest_Request() { +} + // Additional information associated with a StatusRequest type StatusRequest struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -1060,7 +1237,7 @@ type StatusRequest struct { func (x *StatusRequest) Reset() { *x = StatusRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[13] + mi := &file_mpi_v1_command_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1072,7 +1249,7 @@ func (x *StatusRequest) String() string { func (*StatusRequest) ProtoMessage() {} func (x *StatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[13] + mi := &file_mpi_v1_command_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1085,7 +1262,7 @@ func (x *StatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. func (*StatusRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{13} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{15} } // Additional information associated with a HealthRequest @@ -1097,7 +1274,7 @@ type HealthRequest struct { func (x *HealthRequest) Reset() { *x = HealthRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[14] + mi := &file_mpi_v1_command_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1109,7 +1286,7 @@ func (x *HealthRequest) String() string { func (*HealthRequest) ProtoMessage() {} func (x *HealthRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[14] + mi := &file_mpi_v1_command_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1122,7 +1299,7 @@ func (x *HealthRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use HealthRequest.ProtoReflect.Descriptor instead. func (*HealthRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{14} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{16} } // Additional information associated with a ConfigApplyRequest @@ -1136,7 +1313,7 @@ type ConfigApplyRequest struct { func (x *ConfigApplyRequest) Reset() { *x = ConfigApplyRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[15] + mi := &file_mpi_v1_command_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1148,7 +1325,7 @@ func (x *ConfigApplyRequest) String() string { func (*ConfigApplyRequest) ProtoMessage() {} func (x *ConfigApplyRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[15] + mi := &file_mpi_v1_command_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1161,7 +1338,7 @@ func (x *ConfigApplyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfigApplyRequest.ProtoReflect.Descriptor instead. func (*ConfigApplyRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{15} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{17} } func (x *ConfigApplyRequest) GetOverview() *FileOverview { @@ -1182,7 +1359,7 @@ type ConfigUploadRequest struct { func (x *ConfigUploadRequest) Reset() { *x = ConfigUploadRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[16] + mi := &file_mpi_v1_command_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1194,7 +1371,7 @@ func (x *ConfigUploadRequest) String() string { func (*ConfigUploadRequest) ProtoMessage() {} func (x *ConfigUploadRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[16] + mi := &file_mpi_v1_command_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1207,7 +1384,7 @@ func (x *ConfigUploadRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfigUploadRequest.ProtoReflect.Descriptor instead. func (*ConfigUploadRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{16} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{18} } func (x *ConfigUploadRequest) GetOverview() *FileOverview { @@ -1234,7 +1411,7 @@ type APIActionRequest struct { func (x *APIActionRequest) Reset() { *x = APIActionRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[17] + mi := &file_mpi_v1_command_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1246,7 +1423,7 @@ func (x *APIActionRequest) String() string { func (*APIActionRequest) ProtoMessage() {} func (x *APIActionRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[17] + mi := &file_mpi_v1_command_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1259,7 +1436,7 @@ func (x *APIActionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use APIActionRequest.ProtoReflect.Descriptor instead. func (*APIActionRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{17} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{19} } func (x *APIActionRequest) GetInstanceId() string { @@ -1314,7 +1491,7 @@ type NGINXPlusAction struct { func (x *NGINXPlusAction) Reset() { *x = NGINXPlusAction{} - mi := &file_mpi_v1_command_proto_msgTypes[18] + mi := &file_mpi_v1_command_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1326,7 +1503,7 @@ func (x *NGINXPlusAction) String() string { func (*NGINXPlusAction) ProtoMessage() {} func (x *NGINXPlusAction) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[18] + mi := &file_mpi_v1_command_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1339,7 +1516,7 @@ func (x *NGINXPlusAction) ProtoReflect() protoreflect.Message { // Deprecated: Use NGINXPlusAction.ProtoReflect.Descriptor instead. func (*NGINXPlusAction) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{18} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{20} } func (x *NGINXPlusAction) GetAction() isNGINXPlusAction_Action { @@ -1441,7 +1618,7 @@ type UpdateHTTPUpstreamServers struct { func (x *UpdateHTTPUpstreamServers) Reset() { *x = UpdateHTTPUpstreamServers{} - mi := &file_mpi_v1_command_proto_msgTypes[19] + mi := &file_mpi_v1_command_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1453,7 +1630,7 @@ func (x *UpdateHTTPUpstreamServers) String() string { func (*UpdateHTTPUpstreamServers) ProtoMessage() {} func (x *UpdateHTTPUpstreamServers) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[19] + mi := &file_mpi_v1_command_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1466,7 +1643,7 @@ func (x *UpdateHTTPUpstreamServers) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateHTTPUpstreamServers.ProtoReflect.Descriptor instead. func (*UpdateHTTPUpstreamServers) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{19} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{21} } func (x *UpdateHTTPUpstreamServers) GetHttpUpstreamName() string { @@ -1494,7 +1671,7 @@ type GetHTTPUpstreamServers struct { func (x *GetHTTPUpstreamServers) Reset() { *x = GetHTTPUpstreamServers{} - mi := &file_mpi_v1_command_proto_msgTypes[20] + mi := &file_mpi_v1_command_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1506,7 +1683,7 @@ func (x *GetHTTPUpstreamServers) String() string { func (*GetHTTPUpstreamServers) ProtoMessage() {} func (x *GetHTTPUpstreamServers) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[20] + mi := &file_mpi_v1_command_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1519,7 +1696,7 @@ func (x *GetHTTPUpstreamServers) ProtoReflect() protoreflect.Message { // Deprecated: Use GetHTTPUpstreamServers.ProtoReflect.Descriptor instead. func (*GetHTTPUpstreamServers) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{20} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{22} } func (x *GetHTTPUpstreamServers) GetHttpUpstreamName() string { @@ -1542,7 +1719,7 @@ type UpdateStreamServers struct { func (x *UpdateStreamServers) Reset() { *x = UpdateStreamServers{} - mi := &file_mpi_v1_command_proto_msgTypes[21] + mi := &file_mpi_v1_command_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1554,7 +1731,7 @@ func (x *UpdateStreamServers) String() string { func (*UpdateStreamServers) ProtoMessage() {} func (x *UpdateStreamServers) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[21] + mi := &file_mpi_v1_command_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1567,7 +1744,7 @@ func (x *UpdateStreamServers) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateStreamServers.ProtoReflect.Descriptor instead. func (*UpdateStreamServers) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{21} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{23} } func (x *UpdateStreamServers) GetUpstreamStreamName() string { @@ -1593,7 +1770,7 @@ type GetUpstreams struct { func (x *GetUpstreams) Reset() { *x = GetUpstreams{} - mi := &file_mpi_v1_command_proto_msgTypes[22] + mi := &file_mpi_v1_command_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1605,7 +1782,7 @@ func (x *GetUpstreams) String() string { func (*GetUpstreams) ProtoMessage() {} func (x *GetUpstreams) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[22] + mi := &file_mpi_v1_command_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1618,7 +1795,7 @@ func (x *GetUpstreams) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUpstreams.ProtoReflect.Descriptor instead. func (*GetUpstreams) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{22} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{24} } // Get Stream Upstream Servers for an instance @@ -1630,7 +1807,7 @@ type GetStreamUpstreams struct { func (x *GetStreamUpstreams) Reset() { *x = GetStreamUpstreams{} - mi := &file_mpi_v1_command_proto_msgTypes[23] + mi := &file_mpi_v1_command_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1642,7 +1819,7 @@ func (x *GetStreamUpstreams) String() string { func (*GetStreamUpstreams) ProtoMessage() {} func (x *GetStreamUpstreams) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[23] + mi := &file_mpi_v1_command_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1655,7 +1832,7 @@ func (x *GetStreamUpstreams) ProtoReflect() protoreflect.Message { // Deprecated: Use GetStreamUpstreams.ProtoReflect.Descriptor instead. func (*GetStreamUpstreams) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{23} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{25} } // Request an update on a particular command @@ -1667,7 +1844,7 @@ type CommandStatusRequest struct { func (x *CommandStatusRequest) Reset() { *x = CommandStatusRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[24] + mi := &file_mpi_v1_command_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1679,7 +1856,7 @@ func (x *CommandStatusRequest) String() string { func (*CommandStatusRequest) ProtoMessage() {} func (x *CommandStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[24] + mi := &file_mpi_v1_command_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1692,7 +1869,7 @@ func (x *CommandStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CommandStatusRequest.ProtoReflect.Descriptor instead. func (*CommandStatusRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{24} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{26} } // This represents an instance being reported on @@ -1710,7 +1887,7 @@ type Instance struct { func (x *Instance) Reset() { *x = Instance{} - mi := &file_mpi_v1_command_proto_msgTypes[25] + mi := &file_mpi_v1_command_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1722,7 +1899,7 @@ func (x *Instance) String() string { func (*Instance) ProtoMessage() {} func (x *Instance) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[25] + mi := &file_mpi_v1_command_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1735,7 +1912,7 @@ func (x *Instance) ProtoReflect() protoreflect.Message { // Deprecated: Use Instance.ProtoReflect.Descriptor instead. func (*Instance) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{25} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{27} } func (x *Instance) GetInstanceMeta() *InstanceMeta { @@ -1774,7 +1951,7 @@ type InstanceMeta struct { func (x *InstanceMeta) Reset() { *x = InstanceMeta{} - mi := &file_mpi_v1_command_proto_msgTypes[26] + mi := &file_mpi_v1_command_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1786,7 +1963,7 @@ func (x *InstanceMeta) String() string { func (*InstanceMeta) ProtoMessage() {} func (x *InstanceMeta) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[26] + mi := &file_mpi_v1_command_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1799,7 +1976,7 @@ func (x *InstanceMeta) ProtoReflect() protoreflect.Message { // Deprecated: Use InstanceMeta.ProtoReflect.Descriptor instead. func (*InstanceMeta) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{26} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{28} } func (x *InstanceMeta) GetInstanceId() string { @@ -1838,7 +2015,7 @@ type InstanceConfig struct { func (x *InstanceConfig) Reset() { *x = InstanceConfig{} - mi := &file_mpi_v1_command_proto_msgTypes[27] + mi := &file_mpi_v1_command_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1850,7 +2027,7 @@ func (x *InstanceConfig) String() string { func (*InstanceConfig) ProtoMessage() {} func (x *InstanceConfig) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[27] + mi := &file_mpi_v1_command_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1863,7 +2040,7 @@ func (x *InstanceConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use InstanceConfig.ProtoReflect.Descriptor instead. func (*InstanceConfig) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{27} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{29} } func (x *InstanceConfig) GetActions() []*InstanceAction { @@ -1924,7 +2101,7 @@ type InstanceRuntime struct { func (x *InstanceRuntime) Reset() { *x = InstanceRuntime{} - mi := &file_mpi_v1_command_proto_msgTypes[28] + mi := &file_mpi_v1_command_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1936,7 +2113,7 @@ func (x *InstanceRuntime) String() string { func (*InstanceRuntime) ProtoMessage() {} func (x *InstanceRuntime) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[28] + mi := &file_mpi_v1_command_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1949,7 +2126,7 @@ func (x *InstanceRuntime) ProtoReflect() protoreflect.Message { // Deprecated: Use InstanceRuntime.ProtoReflect.Descriptor instead. func (*InstanceRuntime) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{28} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{30} } func (x *InstanceRuntime) GetProcessId() int32 { @@ -2049,7 +2226,7 @@ type InstanceChild struct { func (x *InstanceChild) Reset() { *x = InstanceChild{} - mi := &file_mpi_v1_command_proto_msgTypes[29] + mi := &file_mpi_v1_command_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2061,7 +2238,7 @@ func (x *InstanceChild) String() string { func (*InstanceChild) ProtoMessage() {} func (x *InstanceChild) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[29] + mi := &file_mpi_v1_command_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2074,7 +2251,7 @@ func (x *InstanceChild) ProtoReflect() protoreflect.Message { // Deprecated: Use InstanceChild.ProtoReflect.Descriptor instead. func (*InstanceChild) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{29} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{31} } func (x *InstanceChild) GetProcessId() int32 { @@ -2103,7 +2280,7 @@ type NGINXRuntimeInfo struct { func (x *NGINXRuntimeInfo) Reset() { *x = NGINXRuntimeInfo{} - mi := &file_mpi_v1_command_proto_msgTypes[30] + mi := &file_mpi_v1_command_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2115,7 +2292,7 @@ func (x *NGINXRuntimeInfo) String() string { func (*NGINXRuntimeInfo) ProtoMessage() {} func (x *NGINXRuntimeInfo) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[30] + mi := &file_mpi_v1_command_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2128,7 +2305,7 @@ func (x *NGINXRuntimeInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use NGINXRuntimeInfo.ProtoReflect.Descriptor instead. func (*NGINXRuntimeInfo) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{30} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{32} } func (x *NGINXRuntimeInfo) GetStubStatus() *APIDetails { @@ -2187,7 +2364,7 @@ type NGINXPlusRuntimeInfo struct { func (x *NGINXPlusRuntimeInfo) Reset() { *x = NGINXPlusRuntimeInfo{} - mi := &file_mpi_v1_command_proto_msgTypes[31] + mi := &file_mpi_v1_command_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2199,7 +2376,7 @@ func (x *NGINXPlusRuntimeInfo) String() string { func (*NGINXPlusRuntimeInfo) ProtoMessage() {} func (x *NGINXPlusRuntimeInfo) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[31] + mi := &file_mpi_v1_command_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2212,7 +2389,7 @@ func (x *NGINXPlusRuntimeInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use NGINXPlusRuntimeInfo.ProtoReflect.Descriptor instead. func (*NGINXPlusRuntimeInfo) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{31} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{33} } func (x *NGINXPlusRuntimeInfo) GetStubStatus() *APIDetails { @@ -2271,7 +2448,7 @@ type APIDetails struct { func (x *APIDetails) Reset() { *x = APIDetails{} - mi := &file_mpi_v1_command_proto_msgTypes[32] + mi := &file_mpi_v1_command_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2283,7 +2460,7 @@ func (x *APIDetails) String() string { func (*APIDetails) ProtoMessage() {} func (x *APIDetails) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[32] + mi := &file_mpi_v1_command_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2296,7 +2473,7 @@ func (x *APIDetails) ProtoReflect() protoreflect.Message { // Deprecated: Use APIDetails.ProtoReflect.Descriptor instead. func (*APIDetails) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{32} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{34} } func (x *APIDetails) GetLocation() string { @@ -2337,7 +2514,7 @@ type NGINXAppProtectRuntimeInfo struct { func (x *NGINXAppProtectRuntimeInfo) Reset() { *x = NGINXAppProtectRuntimeInfo{} - mi := &file_mpi_v1_command_proto_msgTypes[33] + mi := &file_mpi_v1_command_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2349,7 +2526,7 @@ func (x *NGINXAppProtectRuntimeInfo) String() string { func (*NGINXAppProtectRuntimeInfo) ProtoMessage() {} func (x *NGINXAppProtectRuntimeInfo) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[33] + mi := &file_mpi_v1_command_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2362,7 +2539,7 @@ func (x *NGINXAppProtectRuntimeInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use NGINXAppProtectRuntimeInfo.ProtoReflect.Descriptor instead. func (*NGINXAppProtectRuntimeInfo) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{33} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{35} } func (x *NGINXAppProtectRuntimeInfo) GetRelease() string { @@ -2402,7 +2579,7 @@ type InstanceAction struct { func (x *InstanceAction) Reset() { *x = InstanceAction{} - mi := &file_mpi_v1_command_proto_msgTypes[34] + mi := &file_mpi_v1_command_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2414,7 +2591,7 @@ func (x *InstanceAction) String() string { func (*InstanceAction) ProtoMessage() {} func (x *InstanceAction) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[34] + mi := &file_mpi_v1_command_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2427,7 +2604,7 @@ func (x *InstanceAction) ProtoReflect() protoreflect.Message { // Deprecated: Use InstanceAction.ProtoReflect.Descriptor instead. func (*InstanceAction) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{34} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{36} } // This contains a series of NGINX Agent configurations @@ -2447,13 +2624,15 @@ type AgentConfig struct { MessageBufferSize string `protobuf:"bytes,6,opt,name=message_buffer_size,json=messageBufferSize,proto3" json:"message_buffer_size,omitempty"` // Auxiliary Command server settings AuxiliaryCommand *AuxiliaryCommandServer `protobuf:"bytes,7,opt,name=auxiliary_command,json=auxiliaryCommand,proto3" json:"auxiliary_command,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // Log settings + Log *Log `protobuf:"bytes,8,opt,name=log,proto3" json:"log,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AgentConfig) Reset() { *x = AgentConfig{} - mi := &file_mpi_v1_command_proto_msgTypes[35] + mi := &file_mpi_v1_command_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2465,7 +2644,7 @@ func (x *AgentConfig) String() string { func (*AgentConfig) ProtoMessage() {} func (x *AgentConfig) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[35] + mi := &file_mpi_v1_command_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2478,7 +2657,7 @@ func (x *AgentConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use AgentConfig.ProtoReflect.Descriptor instead. func (*AgentConfig) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{35} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{37} } func (x *AgentConfig) GetCommand() *CommandServer { @@ -2530,6 +2709,66 @@ func (x *AgentConfig) GetAuxiliaryCommand() *AuxiliaryCommandServer { return nil } +func (x *AgentConfig) GetLog() *Log { + if x != nil { + return x.Log + } + return nil +} + +// The log settings associated with NGINX Agent +type Log struct { + state protoimpl.MessageState `protogen:"open.v1"` + LogLevel Log_LogLevel `protobuf:"varint,1,opt,name=log_level,json=logLevel,proto3,enum=mpi.v1.Log_LogLevel" json:"log_level,omitempty"` + LogPath string `protobuf:"bytes,2,opt,name=log_path,json=logPath,proto3" json:"log_path,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Log) Reset() { + *x = Log{} + mi := &file_mpi_v1_command_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Log) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Log) ProtoMessage() {} + +func (x *Log) ProtoReflect() protoreflect.Message { + mi := &file_mpi_v1_command_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Log.ProtoReflect.Descriptor instead. +func (*Log) Descriptor() ([]byte, []int) { + return file_mpi_v1_command_proto_rawDescGZIP(), []int{38} +} + +func (x *Log) GetLogLevel() Log_LogLevel { + if x != nil { + return x.LogLevel + } + return Log_LOG_LEVEL_UNSPECIFIED +} + +func (x *Log) GetLogPath() string { + if x != nil { + return x.LogPath + } + return "" +} + // The command server settings, associated with messaging from an external source type CommandServer struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -2545,7 +2784,7 @@ type CommandServer struct { func (x *CommandServer) Reset() { *x = CommandServer{} - mi := &file_mpi_v1_command_proto_msgTypes[36] + mi := &file_mpi_v1_command_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2557,7 +2796,7 @@ func (x *CommandServer) String() string { func (*CommandServer) ProtoMessage() {} func (x *CommandServer) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[36] + mi := &file_mpi_v1_command_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2570,7 +2809,7 @@ func (x *CommandServer) ProtoReflect() protoreflect.Message { // Deprecated: Use CommandServer.ProtoReflect.Descriptor instead. func (*CommandServer) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{36} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{39} } func (x *CommandServer) GetServer() *ServerSettings { @@ -2609,7 +2848,7 @@ type AuxiliaryCommandServer struct { func (x *AuxiliaryCommandServer) Reset() { *x = AuxiliaryCommandServer{} - mi := &file_mpi_v1_command_proto_msgTypes[37] + mi := &file_mpi_v1_command_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2621,7 +2860,7 @@ func (x *AuxiliaryCommandServer) String() string { func (*AuxiliaryCommandServer) ProtoMessage() {} func (x *AuxiliaryCommandServer) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[37] + mi := &file_mpi_v1_command_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2634,7 +2873,7 @@ func (x *AuxiliaryCommandServer) ProtoReflect() protoreflect.Message { // Deprecated: Use AuxiliaryCommandServer.ProtoReflect.Descriptor instead. func (*AuxiliaryCommandServer) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{37} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{40} } func (x *AuxiliaryCommandServer) GetServer() *ServerSettings { @@ -2667,7 +2906,7 @@ type MetricsServer struct { func (x *MetricsServer) Reset() { *x = MetricsServer{} - mi := &file_mpi_v1_command_proto_msgTypes[38] + mi := &file_mpi_v1_command_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2679,7 +2918,7 @@ func (x *MetricsServer) String() string { func (*MetricsServer) ProtoMessage() {} func (x *MetricsServer) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[38] + mi := &file_mpi_v1_command_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2692,7 +2931,7 @@ func (x *MetricsServer) ProtoReflect() protoreflect.Message { // Deprecated: Use MetricsServer.ProtoReflect.Descriptor instead. func (*MetricsServer) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{38} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{41} } // The file settings associated with file server for configurations @@ -2704,7 +2943,7 @@ type FileServer struct { func (x *FileServer) Reset() { *x = FileServer{} - mi := &file_mpi_v1_command_proto_msgTypes[39] + mi := &file_mpi_v1_command_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2716,7 +2955,7 @@ func (x *FileServer) String() string { func (*FileServer) ProtoMessage() {} func (x *FileServer) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[39] + mi := &file_mpi_v1_command_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2729,7 +2968,7 @@ func (x *FileServer) ProtoReflect() protoreflect.Message { // Deprecated: Use FileServer.ProtoReflect.Descriptor instead. func (*FileServer) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{39} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{42} } var File_mpi_v1_command_proto protoreflect.FileDescriptor @@ -2768,7 +3007,12 @@ const file_mpi_v1_command_proto_rawDesc = "" + "\x1cUpdateDataPlaneStatusRequest\x126\n" + "\fmessage_meta\x18\x01 \x01(\v2\x13.mpi.v1.MessageMetaR\vmessageMeta\x12,\n" + "\bresource\x18\x02 \x01(\v2\x10.mpi.v1.ResourceR\bresource\"\x1f\n" + - "\x1dUpdateDataPlaneStatusResponse\"\xf0\x02\n" + + "\x1dUpdateDataPlaneStatusResponse\"\x96\x01\n" + + "$UpdateNginxAgentConfigurationRequest\x126\n" + + "\fmessage_meta\x18\x01 \x01(\v2\x13.mpi.v1.MessageMetaR\vmessageMeta\x126\n" + + "\fagent_config\x18\x02 \x01(\v2\x13.mpi.v1.AgentConfigR\vagentConfig\"\\\n" + + "%UpdateNginxAgentConfigurationResponse\x123\n" + + "\bresponse\x18\x01 \x01(\v2\x17.mpi.v1.CommandResponseR\bresponse\"\xf0\x02\n" + "\x0eInstanceHealth\x12)\n" + "\vinstance_id\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\n" + "instanceId\x12a\n" + @@ -2787,7 +3031,7 @@ const file_mpi_v1_command_proto_rawDesc = "" + "\fmessage_meta\x18\x01 \x01(\v2\x13.mpi.v1.MessageMetaR\vmessageMeta\x12B\n" + "\x10command_response\x18\x02 \x01(\v2\x17.mpi.v1.CommandResponseR\x0fcommandResponse\x12\x1f\n" + "\vinstance_id\x18\x03 \x01(\tR\n" + - "instanceId\"\x97\x04\n" + + "instanceId\"\xa0\x05\n" + "\x16ManagementPlaneRequest\x126\n" + "\fmessage_meta\x18\x01 \x01(\v2\x13.mpi.v1.MessageMetaR\vmessageMeta\x12>\n" + "\x0estatus_request\x18\x02 \x01(\v2\x15.mpi.v1.StatusRequestH\x00R\rstatusRequest\x12>\n" + @@ -2795,7 +3039,8 @@ const file_mpi_v1_command_proto_rawDesc = "" + "\x14config_apply_request\x18\x05 \x01(\v2\x1a.mpi.v1.ConfigApplyRequestH\x00R\x12configApplyRequest\x12Q\n" + "\x15config_upload_request\x18\x06 \x01(\v2\x1b.mpi.v1.ConfigUploadRequestH\x00R\x13configUploadRequest\x12A\n" + "\x0eaction_request\x18\a \x01(\v2\x18.mpi.v1.APIActionRequestH\x00R\ractionRequest\x12T\n" + - "\x16command_status_request\x18\b \x01(\v2\x1c.mpi.v1.CommandStatusRequestH\x00R\x14commandStatusRequestB\t\n" + + "\x16command_status_request\x18\b \x01(\v2\x1c.mpi.v1.CommandStatusRequestH\x00R\x14commandStatusRequest\x12\x86\x01\n" + + "(update_nginx_agent_configuration_request\x18\t \x01(\v2,.mpi.v1.UpdateNginxAgentConfigurationRequestH\x00R$updateNginxAgentConfigurationRequestB\t\n" + "\arequest\"\x0f\n" + "\rStatusRequest\"\x0f\n" + "\rHealthRequest\"F\n" + @@ -2892,7 +3137,7 @@ const file_mpi_v1_command_proto_rawDesc = "" + "\x18attack_signature_version\x18\x02 \x01(\tR\x16attackSignatureVersion\x126\n" + "\x17threat_campaign_version\x18\x03 \x01(\tR\x15threatCampaignVersion\x126\n" + "\x17enforcer_engine_version\x18\x04 \x01(\tR\x15enforcerEngineVersion\"\x10\n" + - "\x0eInstanceAction\"\xe1\x02\n" + + "\x0eInstanceAction\"\x80\x03\n" + "\vAgentConfig\x12/\n" + "\acommand\x18\x01 \x01(\v2\x15.mpi.v1.CommandServerR\acommand\x12/\n" + "\ametrics\x18\x02 \x01(\v2\x15.mpi.v1.MetricsServerR\ametrics\x12&\n" + @@ -2900,7 +3145,17 @@ const file_mpi_v1_command_proto_rawDesc = "" + "\x06labels\x18\x04 \x03(\v2\x17.google.protobuf.StructR\x06labels\x12\x1a\n" + "\bfeatures\x18\x05 \x03(\tR\bfeatures\x12.\n" + "\x13message_buffer_size\x18\x06 \x01(\tR\x11messageBufferSize\x12K\n" + - "\x11auxiliary_command\x18\a \x01(\v2\x1e.mpi.v1.AuxiliaryCommandServerR\x10auxiliaryCommand\"\x90\x01\n" + + "\x11auxiliary_command\x18\a \x01(\v2\x1e.mpi.v1.AuxiliaryCommandServerR\x10auxiliaryCommand\x12\x1d\n" + + "\x03log\x18\b \x01(\v2\v.mpi.v1.LogR\x03log\"\xcc\x01\n" + + "\x03Log\x121\n" + + "\tlog_level\x18\x01 \x01(\x0e2\x14.mpi.v1.Log.LogLevelR\blogLevel\x12\x19\n" + + "\blog_path\x18\x02 \x01(\tR\alogPath\"w\n" + + "\bLogLevel\x12\x19\n" + + "\x15LOG_LEVEL_UNSPECIFIED\x10\x00\x12\x13\n" + + "\x0fLOG_LEVEL_ERROR\x10\x01\x12\x12\n" + + "\x0eLOG_LEVEL_WARN\x10\x02\x12\x12\n" + + "\x0eLOG_LEVEL_INFO\x10\x03\x12\x13\n" + + "\x0fLOG_LEVEL_DEBUG\x10\x04\"\x90\x01\n" + "\rCommandServer\x12.\n" + "\x06server\x18\x01 \x01(\v2\x16.mpi.v1.ServerSettingsR\x06server\x12(\n" + "\x04auth\x18\x02 \x01(\v2\x14.mpi.v1.AuthSettingsR\x04auth\x12%\n" + @@ -2930,130 +3185,140 @@ func file_mpi_v1_command_proto_rawDescGZIP() []byte { return file_mpi_v1_command_proto_rawDescData } -var file_mpi_v1_command_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_mpi_v1_command_proto_msgTypes = make([]protoimpl.MessageInfo, 40) +var file_mpi_v1_command_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_mpi_v1_command_proto_msgTypes = make([]protoimpl.MessageInfo, 43) var file_mpi_v1_command_proto_goTypes = []any{ - (InstanceHealth_InstanceHealthStatus)(0), // 0: mpi.v1.InstanceHealth.InstanceHealthStatus - (InstanceMeta_InstanceType)(0), // 1: mpi.v1.InstanceMeta.InstanceType - (*CreateConnectionRequest)(nil), // 2: mpi.v1.CreateConnectionRequest - (*Resource)(nil), // 3: mpi.v1.Resource - (*HostInfo)(nil), // 4: mpi.v1.HostInfo - (*ReleaseInfo)(nil), // 5: mpi.v1.ReleaseInfo - (*ContainerInfo)(nil), // 6: mpi.v1.ContainerInfo - (*CreateConnectionResponse)(nil), // 7: mpi.v1.CreateConnectionResponse - (*UpdateDataPlaneStatusRequest)(nil), // 8: mpi.v1.UpdateDataPlaneStatusRequest - (*UpdateDataPlaneStatusResponse)(nil), // 9: mpi.v1.UpdateDataPlaneStatusResponse - (*InstanceHealth)(nil), // 10: mpi.v1.InstanceHealth - (*UpdateDataPlaneHealthRequest)(nil), // 11: mpi.v1.UpdateDataPlaneHealthRequest - (*UpdateDataPlaneHealthResponse)(nil), // 12: mpi.v1.UpdateDataPlaneHealthResponse - (*DataPlaneResponse)(nil), // 13: mpi.v1.DataPlaneResponse - (*ManagementPlaneRequest)(nil), // 14: mpi.v1.ManagementPlaneRequest - (*StatusRequest)(nil), // 15: mpi.v1.StatusRequest - (*HealthRequest)(nil), // 16: mpi.v1.HealthRequest - (*ConfigApplyRequest)(nil), // 17: mpi.v1.ConfigApplyRequest - (*ConfigUploadRequest)(nil), // 18: mpi.v1.ConfigUploadRequest - (*APIActionRequest)(nil), // 19: mpi.v1.APIActionRequest - (*NGINXPlusAction)(nil), // 20: mpi.v1.NGINXPlusAction - (*UpdateHTTPUpstreamServers)(nil), // 21: mpi.v1.UpdateHTTPUpstreamServers - (*GetHTTPUpstreamServers)(nil), // 22: mpi.v1.GetHTTPUpstreamServers - (*UpdateStreamServers)(nil), // 23: mpi.v1.UpdateStreamServers - (*GetUpstreams)(nil), // 24: mpi.v1.GetUpstreams - (*GetStreamUpstreams)(nil), // 25: mpi.v1.GetStreamUpstreams - (*CommandStatusRequest)(nil), // 26: mpi.v1.CommandStatusRequest - (*Instance)(nil), // 27: mpi.v1.Instance - (*InstanceMeta)(nil), // 28: mpi.v1.InstanceMeta - (*InstanceConfig)(nil), // 29: mpi.v1.InstanceConfig - (*InstanceRuntime)(nil), // 30: mpi.v1.InstanceRuntime - (*InstanceChild)(nil), // 31: mpi.v1.InstanceChild - (*NGINXRuntimeInfo)(nil), // 32: mpi.v1.NGINXRuntimeInfo - (*NGINXPlusRuntimeInfo)(nil), // 33: mpi.v1.NGINXPlusRuntimeInfo - (*APIDetails)(nil), // 34: mpi.v1.APIDetails - (*NGINXAppProtectRuntimeInfo)(nil), // 35: mpi.v1.NGINXAppProtectRuntimeInfo - (*InstanceAction)(nil), // 36: mpi.v1.InstanceAction - (*AgentConfig)(nil), // 37: mpi.v1.AgentConfig - (*CommandServer)(nil), // 38: mpi.v1.CommandServer - (*AuxiliaryCommandServer)(nil), // 39: mpi.v1.AuxiliaryCommandServer - (*MetricsServer)(nil), // 40: mpi.v1.MetricsServer - (*FileServer)(nil), // 41: mpi.v1.FileServer - (*MessageMeta)(nil), // 42: mpi.v1.MessageMeta - (*CommandResponse)(nil), // 43: mpi.v1.CommandResponse - (*FileOverview)(nil), // 44: mpi.v1.FileOverview - (*structpb.Struct)(nil), // 45: google.protobuf.Struct - (*ServerSettings)(nil), // 46: mpi.v1.ServerSettings - (*AuthSettings)(nil), // 47: mpi.v1.AuthSettings - (*TLSSettings)(nil), // 48: mpi.v1.TLSSettings + (InstanceHealth_InstanceHealthStatus)(0), // 0: mpi.v1.InstanceHealth.InstanceHealthStatus + (InstanceMeta_InstanceType)(0), // 1: mpi.v1.InstanceMeta.InstanceType + (Log_LogLevel)(0), // 2: mpi.v1.Log.LogLevel + (*CreateConnectionRequest)(nil), // 3: mpi.v1.CreateConnectionRequest + (*Resource)(nil), // 4: mpi.v1.Resource + (*HostInfo)(nil), // 5: mpi.v1.HostInfo + (*ReleaseInfo)(nil), // 6: mpi.v1.ReleaseInfo + (*ContainerInfo)(nil), // 7: mpi.v1.ContainerInfo + (*CreateConnectionResponse)(nil), // 8: mpi.v1.CreateConnectionResponse + (*UpdateDataPlaneStatusRequest)(nil), // 9: mpi.v1.UpdateDataPlaneStatusRequest + (*UpdateDataPlaneStatusResponse)(nil), // 10: mpi.v1.UpdateDataPlaneStatusResponse + (*UpdateNginxAgentConfigurationRequest)(nil), // 11: mpi.v1.UpdateNginxAgentConfigurationRequest + (*UpdateNginxAgentConfigurationResponse)(nil), // 12: mpi.v1.UpdateNginxAgentConfigurationResponse + (*InstanceHealth)(nil), // 13: mpi.v1.InstanceHealth + (*UpdateDataPlaneHealthRequest)(nil), // 14: mpi.v1.UpdateDataPlaneHealthRequest + (*UpdateDataPlaneHealthResponse)(nil), // 15: mpi.v1.UpdateDataPlaneHealthResponse + (*DataPlaneResponse)(nil), // 16: mpi.v1.DataPlaneResponse + (*ManagementPlaneRequest)(nil), // 17: mpi.v1.ManagementPlaneRequest + (*StatusRequest)(nil), // 18: mpi.v1.StatusRequest + (*HealthRequest)(nil), // 19: mpi.v1.HealthRequest + (*ConfigApplyRequest)(nil), // 20: mpi.v1.ConfigApplyRequest + (*ConfigUploadRequest)(nil), // 21: mpi.v1.ConfigUploadRequest + (*APIActionRequest)(nil), // 22: mpi.v1.APIActionRequest + (*NGINXPlusAction)(nil), // 23: mpi.v1.NGINXPlusAction + (*UpdateHTTPUpstreamServers)(nil), // 24: mpi.v1.UpdateHTTPUpstreamServers + (*GetHTTPUpstreamServers)(nil), // 25: mpi.v1.GetHTTPUpstreamServers + (*UpdateStreamServers)(nil), // 26: mpi.v1.UpdateStreamServers + (*GetUpstreams)(nil), // 27: mpi.v1.GetUpstreams + (*GetStreamUpstreams)(nil), // 28: mpi.v1.GetStreamUpstreams + (*CommandStatusRequest)(nil), // 29: mpi.v1.CommandStatusRequest + (*Instance)(nil), // 30: mpi.v1.Instance + (*InstanceMeta)(nil), // 31: mpi.v1.InstanceMeta + (*InstanceConfig)(nil), // 32: mpi.v1.InstanceConfig + (*InstanceRuntime)(nil), // 33: mpi.v1.InstanceRuntime + (*InstanceChild)(nil), // 34: mpi.v1.InstanceChild + (*NGINXRuntimeInfo)(nil), // 35: mpi.v1.NGINXRuntimeInfo + (*NGINXPlusRuntimeInfo)(nil), // 36: mpi.v1.NGINXPlusRuntimeInfo + (*APIDetails)(nil), // 37: mpi.v1.APIDetails + (*NGINXAppProtectRuntimeInfo)(nil), // 38: mpi.v1.NGINXAppProtectRuntimeInfo + (*InstanceAction)(nil), // 39: mpi.v1.InstanceAction + (*AgentConfig)(nil), // 40: mpi.v1.AgentConfig + (*Log)(nil), // 41: mpi.v1.Log + (*CommandServer)(nil), // 42: mpi.v1.CommandServer + (*AuxiliaryCommandServer)(nil), // 43: mpi.v1.AuxiliaryCommandServer + (*MetricsServer)(nil), // 44: mpi.v1.MetricsServer + (*FileServer)(nil), // 45: mpi.v1.FileServer + (*MessageMeta)(nil), // 46: mpi.v1.MessageMeta + (*CommandResponse)(nil), // 47: mpi.v1.CommandResponse + (*FileOverview)(nil), // 48: mpi.v1.FileOverview + (*structpb.Struct)(nil), // 49: google.protobuf.Struct + (*ServerSettings)(nil), // 50: mpi.v1.ServerSettings + (*AuthSettings)(nil), // 51: mpi.v1.AuthSettings + (*TLSSettings)(nil), // 52: mpi.v1.TLSSettings } var file_mpi_v1_command_proto_depIdxs = []int32{ - 42, // 0: mpi.v1.CreateConnectionRequest.message_meta:type_name -> mpi.v1.MessageMeta - 3, // 1: mpi.v1.CreateConnectionRequest.resource:type_name -> mpi.v1.Resource - 27, // 2: mpi.v1.Resource.instances:type_name -> mpi.v1.Instance - 4, // 3: mpi.v1.Resource.host_info:type_name -> mpi.v1.HostInfo - 6, // 4: mpi.v1.Resource.container_info:type_name -> mpi.v1.ContainerInfo - 5, // 5: mpi.v1.HostInfo.release_info:type_name -> mpi.v1.ReleaseInfo - 5, // 6: mpi.v1.ContainerInfo.release_info:type_name -> mpi.v1.ReleaseInfo - 43, // 7: mpi.v1.CreateConnectionResponse.response:type_name -> mpi.v1.CommandResponse - 37, // 8: mpi.v1.CreateConnectionResponse.agent_config:type_name -> mpi.v1.AgentConfig - 42, // 9: mpi.v1.UpdateDataPlaneStatusRequest.message_meta:type_name -> mpi.v1.MessageMeta - 3, // 10: mpi.v1.UpdateDataPlaneStatusRequest.resource:type_name -> mpi.v1.Resource - 0, // 11: mpi.v1.InstanceHealth.instance_health_status:type_name -> mpi.v1.InstanceHealth.InstanceHealthStatus - 42, // 12: mpi.v1.UpdateDataPlaneHealthRequest.message_meta:type_name -> mpi.v1.MessageMeta - 10, // 13: mpi.v1.UpdateDataPlaneHealthRequest.instance_healths:type_name -> mpi.v1.InstanceHealth - 42, // 14: mpi.v1.DataPlaneResponse.message_meta:type_name -> mpi.v1.MessageMeta - 43, // 15: mpi.v1.DataPlaneResponse.command_response:type_name -> mpi.v1.CommandResponse - 42, // 16: mpi.v1.ManagementPlaneRequest.message_meta:type_name -> mpi.v1.MessageMeta - 15, // 17: mpi.v1.ManagementPlaneRequest.status_request:type_name -> mpi.v1.StatusRequest - 16, // 18: mpi.v1.ManagementPlaneRequest.health_request:type_name -> mpi.v1.HealthRequest - 17, // 19: mpi.v1.ManagementPlaneRequest.config_apply_request:type_name -> mpi.v1.ConfigApplyRequest - 18, // 20: mpi.v1.ManagementPlaneRequest.config_upload_request:type_name -> mpi.v1.ConfigUploadRequest - 19, // 21: mpi.v1.ManagementPlaneRequest.action_request:type_name -> mpi.v1.APIActionRequest - 26, // 22: mpi.v1.ManagementPlaneRequest.command_status_request:type_name -> mpi.v1.CommandStatusRequest - 44, // 23: mpi.v1.ConfigApplyRequest.overview:type_name -> mpi.v1.FileOverview - 44, // 24: mpi.v1.ConfigUploadRequest.overview:type_name -> mpi.v1.FileOverview - 20, // 25: mpi.v1.APIActionRequest.nginx_plus_action:type_name -> mpi.v1.NGINXPlusAction - 21, // 26: mpi.v1.NGINXPlusAction.update_http_upstream_servers:type_name -> mpi.v1.UpdateHTTPUpstreamServers - 22, // 27: mpi.v1.NGINXPlusAction.get_http_upstream_servers:type_name -> mpi.v1.GetHTTPUpstreamServers - 23, // 28: mpi.v1.NGINXPlusAction.update_stream_servers:type_name -> mpi.v1.UpdateStreamServers - 24, // 29: mpi.v1.NGINXPlusAction.get_upstreams:type_name -> mpi.v1.GetUpstreams - 25, // 30: mpi.v1.NGINXPlusAction.get_stream_upstreams:type_name -> mpi.v1.GetStreamUpstreams - 45, // 31: mpi.v1.UpdateHTTPUpstreamServers.servers:type_name -> google.protobuf.Struct - 45, // 32: mpi.v1.UpdateStreamServers.servers:type_name -> google.protobuf.Struct - 28, // 33: mpi.v1.Instance.instance_meta:type_name -> mpi.v1.InstanceMeta - 29, // 34: mpi.v1.Instance.instance_config:type_name -> mpi.v1.InstanceConfig - 30, // 35: mpi.v1.Instance.instance_runtime:type_name -> mpi.v1.InstanceRuntime - 1, // 36: mpi.v1.InstanceMeta.instance_type:type_name -> mpi.v1.InstanceMeta.InstanceType - 36, // 37: mpi.v1.InstanceConfig.actions:type_name -> mpi.v1.InstanceAction - 37, // 38: mpi.v1.InstanceConfig.agent_config:type_name -> mpi.v1.AgentConfig - 32, // 39: mpi.v1.InstanceRuntime.nginx_runtime_info:type_name -> mpi.v1.NGINXRuntimeInfo - 33, // 40: mpi.v1.InstanceRuntime.nginx_plus_runtime_info:type_name -> mpi.v1.NGINXPlusRuntimeInfo - 35, // 41: mpi.v1.InstanceRuntime.nginx_app_protect_runtime_info:type_name -> mpi.v1.NGINXAppProtectRuntimeInfo - 31, // 42: mpi.v1.InstanceRuntime.instance_children:type_name -> mpi.v1.InstanceChild - 34, // 43: mpi.v1.NGINXRuntimeInfo.stub_status:type_name -> mpi.v1.APIDetails - 34, // 44: mpi.v1.NGINXPlusRuntimeInfo.stub_status:type_name -> mpi.v1.APIDetails - 34, // 45: mpi.v1.NGINXPlusRuntimeInfo.plus_api:type_name -> mpi.v1.APIDetails - 38, // 46: mpi.v1.AgentConfig.command:type_name -> mpi.v1.CommandServer - 40, // 47: mpi.v1.AgentConfig.metrics:type_name -> mpi.v1.MetricsServer - 41, // 48: mpi.v1.AgentConfig.file:type_name -> mpi.v1.FileServer - 45, // 49: mpi.v1.AgentConfig.labels:type_name -> google.protobuf.Struct - 39, // 50: mpi.v1.AgentConfig.auxiliary_command:type_name -> mpi.v1.AuxiliaryCommandServer - 46, // 51: mpi.v1.CommandServer.server:type_name -> mpi.v1.ServerSettings - 47, // 52: mpi.v1.CommandServer.auth:type_name -> mpi.v1.AuthSettings - 48, // 53: mpi.v1.CommandServer.tls:type_name -> mpi.v1.TLSSettings - 46, // 54: mpi.v1.AuxiliaryCommandServer.server:type_name -> mpi.v1.ServerSettings - 47, // 55: mpi.v1.AuxiliaryCommandServer.auth:type_name -> mpi.v1.AuthSettings - 48, // 56: mpi.v1.AuxiliaryCommandServer.tls:type_name -> mpi.v1.TLSSettings - 2, // 57: mpi.v1.CommandService.CreateConnection:input_type -> mpi.v1.CreateConnectionRequest - 8, // 58: mpi.v1.CommandService.UpdateDataPlaneStatus:input_type -> mpi.v1.UpdateDataPlaneStatusRequest - 11, // 59: mpi.v1.CommandService.UpdateDataPlaneHealth:input_type -> mpi.v1.UpdateDataPlaneHealthRequest - 13, // 60: mpi.v1.CommandService.Subscribe:input_type -> mpi.v1.DataPlaneResponse - 7, // 61: mpi.v1.CommandService.CreateConnection:output_type -> mpi.v1.CreateConnectionResponse - 9, // 62: mpi.v1.CommandService.UpdateDataPlaneStatus:output_type -> mpi.v1.UpdateDataPlaneStatusResponse - 12, // 63: mpi.v1.CommandService.UpdateDataPlaneHealth:output_type -> mpi.v1.UpdateDataPlaneHealthResponse - 14, // 64: mpi.v1.CommandService.Subscribe:output_type -> mpi.v1.ManagementPlaneRequest - 61, // [61:65] is the sub-list for method output_type - 57, // [57:61] is the sub-list for method input_type - 57, // [57:57] is the sub-list for extension type_name - 57, // [57:57] is the sub-list for extension extendee - 0, // [0:57] is the sub-list for field type_name + 46, // 0: mpi.v1.CreateConnectionRequest.message_meta:type_name -> mpi.v1.MessageMeta + 4, // 1: mpi.v1.CreateConnectionRequest.resource:type_name -> mpi.v1.Resource + 30, // 2: mpi.v1.Resource.instances:type_name -> mpi.v1.Instance + 5, // 3: mpi.v1.Resource.host_info:type_name -> mpi.v1.HostInfo + 7, // 4: mpi.v1.Resource.container_info:type_name -> mpi.v1.ContainerInfo + 6, // 5: mpi.v1.HostInfo.release_info:type_name -> mpi.v1.ReleaseInfo + 6, // 6: mpi.v1.ContainerInfo.release_info:type_name -> mpi.v1.ReleaseInfo + 47, // 7: mpi.v1.CreateConnectionResponse.response:type_name -> mpi.v1.CommandResponse + 40, // 8: mpi.v1.CreateConnectionResponse.agent_config:type_name -> mpi.v1.AgentConfig + 46, // 9: mpi.v1.UpdateDataPlaneStatusRequest.message_meta:type_name -> mpi.v1.MessageMeta + 4, // 10: mpi.v1.UpdateDataPlaneStatusRequest.resource:type_name -> mpi.v1.Resource + 46, // 11: mpi.v1.UpdateNginxAgentConfigurationRequest.message_meta:type_name -> mpi.v1.MessageMeta + 40, // 12: mpi.v1.UpdateNginxAgentConfigurationRequest.agent_config:type_name -> mpi.v1.AgentConfig + 47, // 13: mpi.v1.UpdateNginxAgentConfigurationResponse.response:type_name -> mpi.v1.CommandResponse + 0, // 14: mpi.v1.InstanceHealth.instance_health_status:type_name -> mpi.v1.InstanceHealth.InstanceHealthStatus + 46, // 15: mpi.v1.UpdateDataPlaneHealthRequest.message_meta:type_name -> mpi.v1.MessageMeta + 13, // 16: mpi.v1.UpdateDataPlaneHealthRequest.instance_healths:type_name -> mpi.v1.InstanceHealth + 46, // 17: mpi.v1.DataPlaneResponse.message_meta:type_name -> mpi.v1.MessageMeta + 47, // 18: mpi.v1.DataPlaneResponse.command_response:type_name -> mpi.v1.CommandResponse + 46, // 19: mpi.v1.ManagementPlaneRequest.message_meta:type_name -> mpi.v1.MessageMeta + 18, // 20: mpi.v1.ManagementPlaneRequest.status_request:type_name -> mpi.v1.StatusRequest + 19, // 21: mpi.v1.ManagementPlaneRequest.health_request:type_name -> mpi.v1.HealthRequest + 20, // 22: mpi.v1.ManagementPlaneRequest.config_apply_request:type_name -> mpi.v1.ConfigApplyRequest + 21, // 23: mpi.v1.ManagementPlaneRequest.config_upload_request:type_name -> mpi.v1.ConfigUploadRequest + 22, // 24: mpi.v1.ManagementPlaneRequest.action_request:type_name -> mpi.v1.APIActionRequest + 29, // 25: mpi.v1.ManagementPlaneRequest.command_status_request:type_name -> mpi.v1.CommandStatusRequest + 11, // 26: mpi.v1.ManagementPlaneRequest.update_nginx_agent_configuration_request:type_name -> mpi.v1.UpdateNginxAgentConfigurationRequest + 48, // 27: mpi.v1.ConfigApplyRequest.overview:type_name -> mpi.v1.FileOverview + 48, // 28: mpi.v1.ConfigUploadRequest.overview:type_name -> mpi.v1.FileOverview + 23, // 29: mpi.v1.APIActionRequest.nginx_plus_action:type_name -> mpi.v1.NGINXPlusAction + 24, // 30: mpi.v1.NGINXPlusAction.update_http_upstream_servers:type_name -> mpi.v1.UpdateHTTPUpstreamServers + 25, // 31: mpi.v1.NGINXPlusAction.get_http_upstream_servers:type_name -> mpi.v1.GetHTTPUpstreamServers + 26, // 32: mpi.v1.NGINXPlusAction.update_stream_servers:type_name -> mpi.v1.UpdateStreamServers + 27, // 33: mpi.v1.NGINXPlusAction.get_upstreams:type_name -> mpi.v1.GetUpstreams + 28, // 34: mpi.v1.NGINXPlusAction.get_stream_upstreams:type_name -> mpi.v1.GetStreamUpstreams + 49, // 35: mpi.v1.UpdateHTTPUpstreamServers.servers:type_name -> google.protobuf.Struct + 49, // 36: mpi.v1.UpdateStreamServers.servers:type_name -> google.protobuf.Struct + 31, // 37: mpi.v1.Instance.instance_meta:type_name -> mpi.v1.InstanceMeta + 32, // 38: mpi.v1.Instance.instance_config:type_name -> mpi.v1.InstanceConfig + 33, // 39: mpi.v1.Instance.instance_runtime:type_name -> mpi.v1.InstanceRuntime + 1, // 40: mpi.v1.InstanceMeta.instance_type:type_name -> mpi.v1.InstanceMeta.InstanceType + 39, // 41: mpi.v1.InstanceConfig.actions:type_name -> mpi.v1.InstanceAction + 40, // 42: mpi.v1.InstanceConfig.agent_config:type_name -> mpi.v1.AgentConfig + 35, // 43: mpi.v1.InstanceRuntime.nginx_runtime_info:type_name -> mpi.v1.NGINXRuntimeInfo + 36, // 44: mpi.v1.InstanceRuntime.nginx_plus_runtime_info:type_name -> mpi.v1.NGINXPlusRuntimeInfo + 38, // 45: mpi.v1.InstanceRuntime.nginx_app_protect_runtime_info:type_name -> mpi.v1.NGINXAppProtectRuntimeInfo + 34, // 46: mpi.v1.InstanceRuntime.instance_children:type_name -> mpi.v1.InstanceChild + 37, // 47: mpi.v1.NGINXRuntimeInfo.stub_status:type_name -> mpi.v1.APIDetails + 37, // 48: mpi.v1.NGINXPlusRuntimeInfo.stub_status:type_name -> mpi.v1.APIDetails + 37, // 49: mpi.v1.NGINXPlusRuntimeInfo.plus_api:type_name -> mpi.v1.APIDetails + 42, // 50: mpi.v1.AgentConfig.command:type_name -> mpi.v1.CommandServer + 44, // 51: mpi.v1.AgentConfig.metrics:type_name -> mpi.v1.MetricsServer + 45, // 52: mpi.v1.AgentConfig.file:type_name -> mpi.v1.FileServer + 49, // 53: mpi.v1.AgentConfig.labels:type_name -> google.protobuf.Struct + 43, // 54: mpi.v1.AgentConfig.auxiliary_command:type_name -> mpi.v1.AuxiliaryCommandServer + 41, // 55: mpi.v1.AgentConfig.log:type_name -> mpi.v1.Log + 2, // 56: mpi.v1.Log.log_level:type_name -> mpi.v1.Log.LogLevel + 50, // 57: mpi.v1.CommandServer.server:type_name -> mpi.v1.ServerSettings + 51, // 58: mpi.v1.CommandServer.auth:type_name -> mpi.v1.AuthSettings + 52, // 59: mpi.v1.CommandServer.tls:type_name -> mpi.v1.TLSSettings + 50, // 60: mpi.v1.AuxiliaryCommandServer.server:type_name -> mpi.v1.ServerSettings + 51, // 61: mpi.v1.AuxiliaryCommandServer.auth:type_name -> mpi.v1.AuthSettings + 52, // 62: mpi.v1.AuxiliaryCommandServer.tls:type_name -> mpi.v1.TLSSettings + 3, // 63: mpi.v1.CommandService.CreateConnection:input_type -> mpi.v1.CreateConnectionRequest + 9, // 64: mpi.v1.CommandService.UpdateDataPlaneStatus:input_type -> mpi.v1.UpdateDataPlaneStatusRequest + 14, // 65: mpi.v1.CommandService.UpdateDataPlaneHealth:input_type -> mpi.v1.UpdateDataPlaneHealthRequest + 16, // 66: mpi.v1.CommandService.Subscribe:input_type -> mpi.v1.DataPlaneResponse + 8, // 67: mpi.v1.CommandService.CreateConnection:output_type -> mpi.v1.CreateConnectionResponse + 10, // 68: mpi.v1.CommandService.UpdateDataPlaneStatus:output_type -> mpi.v1.UpdateDataPlaneStatusResponse + 15, // 69: mpi.v1.CommandService.UpdateDataPlaneHealth:output_type -> mpi.v1.UpdateDataPlaneHealthResponse + 17, // 70: mpi.v1.CommandService.Subscribe:output_type -> mpi.v1.ManagementPlaneRequest + 67, // [67:71] is the sub-list for method output_type + 63, // [63:67] is the sub-list for method input_type + 63, // [63:63] is the sub-list for extension type_name + 63, // [63:63] is the sub-list for extension extendee + 0, // [0:63] is the sub-list for field type_name } func init() { file_mpi_v1_command_proto_init() } @@ -3067,28 +3332,29 @@ func file_mpi_v1_command_proto_init() { (*Resource_HostInfo)(nil), (*Resource_ContainerInfo)(nil), } - file_mpi_v1_command_proto_msgTypes[12].OneofWrappers = []any{ + file_mpi_v1_command_proto_msgTypes[14].OneofWrappers = []any{ (*ManagementPlaneRequest_StatusRequest)(nil), (*ManagementPlaneRequest_HealthRequest)(nil), (*ManagementPlaneRequest_ConfigApplyRequest)(nil), (*ManagementPlaneRequest_ConfigUploadRequest)(nil), (*ManagementPlaneRequest_ActionRequest)(nil), (*ManagementPlaneRequest_CommandStatusRequest)(nil), + (*ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest)(nil), } - file_mpi_v1_command_proto_msgTypes[17].OneofWrappers = []any{ + file_mpi_v1_command_proto_msgTypes[19].OneofWrappers = []any{ (*APIActionRequest_NginxPlusAction)(nil), } - file_mpi_v1_command_proto_msgTypes[18].OneofWrappers = []any{ + file_mpi_v1_command_proto_msgTypes[20].OneofWrappers = []any{ (*NGINXPlusAction_UpdateHttpUpstreamServers)(nil), (*NGINXPlusAction_GetHttpUpstreamServers)(nil), (*NGINXPlusAction_UpdateStreamServers)(nil), (*NGINXPlusAction_GetUpstreams)(nil), (*NGINXPlusAction_GetStreamUpstreams)(nil), } - file_mpi_v1_command_proto_msgTypes[27].OneofWrappers = []any{ + file_mpi_v1_command_proto_msgTypes[29].OneofWrappers = []any{ (*InstanceConfig_AgentConfig)(nil), } - file_mpi_v1_command_proto_msgTypes[28].OneofWrappers = []any{ + file_mpi_v1_command_proto_msgTypes[30].OneofWrappers = []any{ (*InstanceRuntime_NginxRuntimeInfo)(nil), (*InstanceRuntime_NginxPlusRuntimeInfo)(nil), (*InstanceRuntime_NginxAppProtectRuntimeInfo)(nil), @@ -3098,8 +3364,8 @@ func file_mpi_v1_command_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_mpi_v1_command_proto_rawDesc), len(file_mpi_v1_command_proto_rawDesc)), - NumEnums: 2, - NumMessages: 40, + NumEnums: 3, + NumMessages: 43, NumExtensions: 0, NumServices: 1, }, diff --git a/api/grpc/mpi/v1/command.pb.validate.go b/api/grpc/mpi/v1/command.pb.validate.go index 81f716548..35efc898d 100644 --- a/api/grpc/mpi/v1/command.pb.validate.go +++ b/api/grpc/mpi/v1/command.pb.validate.go @@ -1215,6 +1215,303 @@ var _ interface { ErrorName() string } = UpdateDataPlaneStatusResponseValidationError{} +// Validate checks the field values on UpdateNginxAgentConfigurationRequest +// with the rules defined in the proto definition for this message. If any +// rules are violated, the first error encountered is returned, or nil if +// there are no violations. +func (m *UpdateNginxAgentConfigurationRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpdateNginxAgentConfigurationRequest +// with the rules defined in the proto definition for this message. If any +// rules are violated, the result is a list of violation errors wrapped in +// UpdateNginxAgentConfigurationRequestMultiError, or nil if none found. +func (m *UpdateNginxAgentConfigurationRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UpdateNginxAgentConfigurationRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetMessageMeta()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpdateNginxAgentConfigurationRequestValidationError{ + field: "MessageMeta", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdateNginxAgentConfigurationRequestValidationError{ + field: "MessageMeta", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMessageMeta()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateNginxAgentConfigurationRequestValidationError{ + field: "MessageMeta", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetAgentConfig()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpdateNginxAgentConfigurationRequestValidationError{ + field: "AgentConfig", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdateNginxAgentConfigurationRequestValidationError{ + field: "AgentConfig", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAgentConfig()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateNginxAgentConfigurationRequestValidationError{ + field: "AgentConfig", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return UpdateNginxAgentConfigurationRequestMultiError(errors) + } + + return nil +} + +// UpdateNginxAgentConfigurationRequestMultiError is an error wrapping multiple +// validation errors returned by +// UpdateNginxAgentConfigurationRequest.ValidateAll() if the designated +// constraints aren't met. +type UpdateNginxAgentConfigurationRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpdateNginxAgentConfigurationRequestMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpdateNginxAgentConfigurationRequestMultiError) AllErrors() []error { return m } + +// UpdateNginxAgentConfigurationRequestValidationError is the validation error +// returned by UpdateNginxAgentConfigurationRequest.Validate if the designated +// constraints aren't met. +type UpdateNginxAgentConfigurationRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateNginxAgentConfigurationRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateNginxAgentConfigurationRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateNginxAgentConfigurationRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateNginxAgentConfigurationRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateNginxAgentConfigurationRequestValidationError) ErrorName() string { + return "UpdateNginxAgentConfigurationRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateNginxAgentConfigurationRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateNginxAgentConfigurationRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateNginxAgentConfigurationRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateNginxAgentConfigurationRequestValidationError{} + +// Validate checks the field values on UpdateNginxAgentConfigurationResponse +// with the rules defined in the proto definition for this message. If any +// rules are violated, the first error encountered is returned, or nil if +// there are no violations. +func (m *UpdateNginxAgentConfigurationResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpdateNginxAgentConfigurationResponse +// with the rules defined in the proto definition for this message. If any +// rules are violated, the result is a list of violation errors wrapped in +// UpdateNginxAgentConfigurationResponseMultiError, or nil if none found. +func (m *UpdateNginxAgentConfigurationResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *UpdateNginxAgentConfigurationResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetResponse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpdateNginxAgentConfigurationResponseValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdateNginxAgentConfigurationResponseValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateNginxAgentConfigurationResponseValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return UpdateNginxAgentConfigurationResponseMultiError(errors) + } + + return nil +} + +// UpdateNginxAgentConfigurationResponseMultiError is an error wrapping +// multiple validation errors returned by +// UpdateNginxAgentConfigurationResponse.ValidateAll() if the designated +// constraints aren't met. +type UpdateNginxAgentConfigurationResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpdateNginxAgentConfigurationResponseMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m UpdateNginxAgentConfigurationResponseMultiError) AllErrors() []error { return m } + +// UpdateNginxAgentConfigurationResponseValidationError is the validation error +// returned by UpdateNginxAgentConfigurationResponse.Validate if the +// designated constraints aren't met. +type UpdateNginxAgentConfigurationResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateNginxAgentConfigurationResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateNginxAgentConfigurationResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateNginxAgentConfigurationResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateNginxAgentConfigurationResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateNginxAgentConfigurationResponseValidationError) ErrorName() string { + return "UpdateNginxAgentConfigurationResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateNginxAgentConfigurationResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sUpdateNginxAgentConfigurationResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateNginxAgentConfigurationResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateNginxAgentConfigurationResponseValidationError{} + // Validate checks the field values on InstanceHealth with the rules defined in // the proto definition for this message. If any rules are violated, the first // error encountered is returned, or nil if there are no violations. @@ -2050,6 +2347,47 @@ func (m *ManagementPlaneRequest) validate(all bool) error { } } + case *ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest: + if v == nil { + err := ManagementPlaneRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetUpdateNginxAgentConfigurationRequest()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ManagementPlaneRequestValidationError{ + field: "UpdateNginxAgentConfigurationRequest", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ManagementPlaneRequestValidationError{ + field: "UpdateNginxAgentConfigurationRequest", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetUpdateNginxAgentConfigurationRequest()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ManagementPlaneRequestValidationError{ + field: "UpdateNginxAgentConfigurationRequest", + reason: "embedded message failed validation", + cause: err, + } + } + } + default: _ = v // ensures v is used } @@ -5356,6 +5694,35 @@ func (m *AgentConfig) validate(all bool) error { } } + if all { + switch v := interface{}(m.GetLog()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AgentConfigValidationError{ + field: "Log", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AgentConfigValidationError{ + field: "Log", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetLog()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AgentConfigValidationError{ + field: "Log", + reason: "embedded message failed validation", + cause: err, + } + } + } + if len(errors) > 0 { return AgentConfigMultiError(errors) } @@ -5433,6 +5800,108 @@ var _ interface { ErrorName() string } = AgentConfigValidationError{} +// Validate checks the field values on Log with the rules defined in the proto +// definition for this message. If any rules are violated, the first error +// encountered is returned, or nil if there are no violations. +func (m *Log) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Log with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in LogMultiError, or nil if none found. +func (m *Log) ValidateAll() error { + return m.validate(true) +} + +func (m *Log) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for LogLevel + + // no validation rules for LogPath + + if len(errors) > 0 { + return LogMultiError(errors) + } + + return nil +} + +// LogMultiError is an error wrapping multiple validation errors returned by +// Log.ValidateAll() if the designated constraints aren't met. +type LogMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m LogMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m LogMultiError) AllErrors() []error { return m } + +// LogValidationError is the validation error returned by Log.Validate if the +// designated constraints aren't met. +type LogValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e LogValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e LogValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e LogValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e LogValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e LogValidationError) ErrorName() string { return "LogValidationError" } + +// Error satisfies the builtin error interface +func (e LogValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sLog.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = LogValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = LogValidationError{} + // Validate checks the field values on CommandServer with the rules defined in // the proto definition for this message. If any rules are violated, the first // error encountered is returned, or nil if there are no violations. diff --git a/api/grpc/mpi/v1/command.proto b/api/grpc/mpi/v1/command.proto index 84fb6a020..4c4d2ab05 100644 --- a/api/grpc/mpi/v1/command.proto +++ b/api/grpc/mpi/v1/command.proto @@ -113,6 +113,18 @@ message UpdateDataPlaneStatusRequest { // Respond to a UpdateDataPlaneStatusRequest - intentionally empty message UpdateDataPlaneStatusResponse {} +message UpdateNginxAgentConfigurationRequest { + // Meta-information associated with a message + mpi.v1.MessageMeta message_meta = 1; + // the NGINX Agent configuration to update + AgentConfig agent_config = 2; +} + +message UpdateNginxAgentConfigurationResponse { + // The success or failure of the UpdateNginxAgentConfigurationRequest + mpi.v1.CommandResponse response = 1; +} + message InstanceHealth { // Health status enum enum InstanceHealthStatus { @@ -171,6 +183,8 @@ message ManagementPlaneRequest { APIActionRequest action_request = 7; // triggers a DataPlaneResponse with a command_response for a particular correlation_id CommandStatusRequest command_status_request = 8; + // triggers an UpdateNginxAgentConfiguration rpc, returning an UpdateNginxAgentConfigurationResponse + UpdateNginxAgentConfigurationRequest update_nginx_agent_configuration_request = 9; } } @@ -387,6 +401,26 @@ message AgentConfig { string message_buffer_size = 6; // Auxiliary Command server settings AuxiliaryCommandServer auxiliary_command = 7; + // Log settings + Log log = 8; +} + +// The log settings associated with NGINX Agent +message Log { + LogLevel log_level = 1; + enum LogLevel { + // Unspecified log level + LOG_LEVEL_UNSPECIFIED = 0; + // Error log level + LOG_LEVEL_ERROR = 1; + // Warning log level + LOG_LEVEL_WARN = 2; + // Info log level + LOG_LEVEL_INFO = 3; + // Debug log level + LOG_LEVEL_DEBUG = 4; + } + string log_path = 2; } // The command server settings, associated with messaging from an external source diff --git a/docs/proto/protos.md b/docs/proto/protos.md index 3ae57f5e4..05c8850cf 100644 --- a/docs/proto/protos.md +++ b/docs/proto/protos.md @@ -67,6 +67,7 @@ - [InstanceHealth](#mpi-v1-InstanceHealth) - [InstanceMeta](#mpi-v1-InstanceMeta) - [InstanceRuntime](#mpi-v1-InstanceRuntime) + - [Log](#mpi-v1-Log) - [ManagementPlaneRequest](#mpi-v1-ManagementPlaneRequest) - [MetricsServer](#mpi-v1-MetricsServer) - [NGINXAppProtectRuntimeInfo](#mpi-v1-NGINXAppProtectRuntimeInfo) @@ -81,10 +82,13 @@ - [UpdateDataPlaneStatusRequest](#mpi-v1-UpdateDataPlaneStatusRequest) - [UpdateDataPlaneStatusResponse](#mpi-v1-UpdateDataPlaneStatusResponse) - [UpdateHTTPUpstreamServers](#mpi-v1-UpdateHTTPUpstreamServers) + - [UpdateNginxAgentConfigurationRequest](#mpi-v1-UpdateNginxAgentConfigurationRequest) + - [UpdateNginxAgentConfigurationResponse](#mpi-v1-UpdateNginxAgentConfigurationResponse) - [UpdateStreamServers](#mpi-v1-UpdateStreamServers) - [InstanceHealth.InstanceHealthStatus](#mpi-v1-InstanceHealth-InstanceHealthStatus) - [InstanceMeta.InstanceType](#mpi-v1-InstanceMeta-InstanceType) + - [Log.LogLevel](#mpi-v1-Log-LogLevel) - [CommandService](#mpi-v1-CommandService) @@ -718,6 +722,7 @@ This contains a series of NGINX Agent configurations | features | [string](#string) | repeated | A list of features that the NGINX Agent has | | message_buffer_size | [string](#string) | | Message buffer size, maximum not acknowledged messages from the subscribe perspective | | auxiliary_command | [AuxiliaryCommandServer](#mpi-v1-AuxiliaryCommandServer) | | Auxiliary Command server settings | +| log | [Log](#mpi-v1-Log) | | Log settings | @@ -1049,6 +1054,22 @@ Meta-information relating to the reported instance + + +### Log +The log settings associated with NGINX Agent + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| log_level | [Log.LogLevel](#mpi-v1-Log-LogLevel) | | | +| log_path | [string](#string) | | | + + + + + + ### ManagementPlaneRequest @@ -1064,6 +1085,7 @@ A Management Plane request for information, triggers an associated rpc on the Da | config_upload_request | [ConfigUploadRequest](#mpi-v1-ConfigUploadRequest) | | triggers a series of rpc UpdateFile(File) for that instances | | action_request | [APIActionRequest](#mpi-v1-APIActionRequest) | | triggers a DataPlaneResponse with a command_response for a particular action | | command_status_request | [CommandStatusRequest](#mpi-v1-CommandStatusRequest) | | triggers a DataPlaneResponse with a command_response for a particular correlation_id | +| update_nginx_agent_configuration_request | [UpdateNginxAgentConfigurationRequest](#mpi-v1-UpdateNginxAgentConfigurationRequest) | | triggers an UpdateNginxAgentConfiguration rpc, returning an UpdateNginxAgentConfigurationResponse | @@ -1271,6 +1293,37 @@ Update HTTP Upstream Servers for an instance + + +### UpdateNginxAgentConfigurationRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| message_meta | [MessageMeta](#mpi-v1-MessageMeta) | | Meta-information associated with a message | +| agent_config | [AgentConfig](#mpi-v1-AgentConfig) | | the NGINX Agent configuration to update | + + + + + + + + +### UpdateNginxAgentConfigurationResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| response | [CommandResponse](#mpi-v1-CommandResponse) | | The success or failure of the UpdateNginxAgentConfigurationRequest | + + + + + + ### UpdateStreamServers @@ -1318,6 +1371,21 @@ the types of instances possible | INSTANCE_TYPE_NGINX_APP_PROTECT | 5 | NGINX App Protect | + + + +### Log.LogLevel + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| LOG_LEVEL_UNSPECIFIED | 0 | Unspecified log level | +| LOG_LEVEL_ERROR | 1 | Error log level | +| LOG_LEVEL_WARN | 2 | Warning log level | +| LOG_LEVEL_INFO | 3 | Info log level | +| LOG_LEVEL_DEBUG | 4 | Debug log level | + + diff --git a/internal/bus/topics.go b/internal/bus/topics.go index 5a778b27a..a4b0e341c 100644 --- a/internal/bus/topics.go +++ b/internal/bus/topics.go @@ -27,4 +27,5 @@ const ( DataPlaneHealthRequestTopic = "data-plane-health-request" DataPlaneHealthResponseTopic = "data-plane-health-response" APIActionRequestTopic = "api-action-request" + AgentConfigUpdateTopic = "agent-config-update" ) diff --git a/internal/command/command_plugin.go b/internal/command/command_plugin.go index 616c48eb8..9673d1b21 100644 --- a/internal/command/command_plugin.go +++ b/internal/command/command_plugin.go @@ -37,6 +37,7 @@ type ( Subscribe(ctx context.Context) IsConnected() bool CreateConnection(ctx context.Context, resource *mpi.Resource) (*mpi.CreateConnectionResponse, error) + UpdateAgentConfiguration(ctx context.Context, request *mpi.AgentConfig) error } CommandPlugin struct { @@ -127,6 +128,8 @@ func (cp *CommandPlugin) Process(ctx context.Context, msg *bus.Message) { cp.processDataPlaneHealth(ctxWithMetadata, msg) case bus.DataPlaneResponseTopic: cp.processDataPlaneResponse(ctxWithMetadata, msg) + case bus.AgentConfigUpdateTopic: + cp.processAgentConfigUpdate(ctxWithMetadata, msg) default: slog.DebugContext(ctxWithMetadata, "Command plugin received unknown topic", "topic", msg.Topic) } @@ -140,6 +143,7 @@ func (cp *CommandPlugin) Subscriptions() []string { bus.InstanceHealthTopic, bus.DataPlaneHealthResponseTopic, bus.DataPlaneResponseTopic, + bus.AgentConfigUpdateTopic, } } @@ -180,6 +184,13 @@ func (cp *CommandPlugin) createConnection(ctx context.Context, resource *mpi.Res Topic: bus.ConnectionCreatedTopic, Data: createConnectionResponse, }) + + // update agent configuration after connection is created, and notify other plugins + _ = cp.commandService.UpdateAgentConfiguration(ctx, createConnectionResponse.AgentConfig) + cp.messagePipe.Process(ctx, &bus.Message{ + Topic: bus.AgentConfigUpdateTopic, + Data: createConnectionResponse.AgentConfig, + }) } } @@ -262,6 +273,19 @@ func (cp *CommandPlugin) processConnectionReset(ctx context.Context, msg *bus.Me } } +func (cp *CommandPlugin) processAgentConfigUpdate(ctx context.Context, msg *bus.Message) { + slog.DebugContext(ctx, "Command plugin received agent config update message", "data", msg.Data) + // + if mpiConf, ok := msg.Data.(*mpi.AgentConfig); ok { + err := cp.commandService.UpdateAgentConfiguration(ctx, mpiConf) + if err != nil { + slog.ErrorContext(ctx, "Unable to update agent configuration", "error", err) + } + } else { + slog.ErrorContext(ctx, "Invalid data for agent config update message", "data", msg.Data) + } +} + //nolint:revive // cognitive complexity is 14 func (cp *CommandPlugin) monitorSubscribeChannel(ctx context.Context) { for { @@ -305,6 +329,9 @@ func (cp *CommandPlugin) monitorSubscribeChannel(ctx context.Context) { } slog.InfoContext(ctx, "Received management plane action request") cp.handleAPIActionRequest(newCtx, message) + case *mpi.ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest: + slog.InfoContext(ctx, "Received management plane request - update agent configuration") + cp.handleAgentConfigUpdateRequest(newCtx, message) default: slog.DebugContext(newCtx, "Management plane request not implemented yet") } @@ -408,6 +435,11 @@ func (cp *CommandPlugin) handleInvalidRequest(ctx context.Context, } } +func (cp *CommandPlugin) handleAgentConfigUpdateRequest(ctx context.Context, request *mpi.ManagementPlaneRequest) { + // notify plugins about the agent config update request + cp.Process(ctx, &bus.Message{Topic: bus.AgentConfigUpdateTopic, Data: request}) +} + func (cp *CommandPlugin) createDataPlaneResponse(correlationID string, status mpi.CommandResponse_CommandStatus, message, err string, ) *mpi.DataPlaneResponse { diff --git a/internal/command/command_plugin_test.go b/internal/command/command_plugin_test.go index c51f3c579..bbe024b40 100644 --- a/internal/command/command_plugin_test.go +++ b/internal/command/command_plugin_test.go @@ -151,6 +151,17 @@ func TestCommandPlugin_Process(t *testing.T) { Data: commandPlugin.conn, }) require.Equal(t, 1, fakeCommandService.UpdateClientCallCount()) + + commandPlugin.Process(ctx, &bus.Message{ + Topic: bus.AgentConfigUpdateTopic, + Data: mpi.AgentConfig{ + Log: &mpi.Log{ + LogLevel: mpi.Log_LOG_LEVEL_DEBUG, + LogPath: "somewhere", + }, + }, + }) + require.Equal(t, 1, fakeCommandService.UpdateAgentConfigurationCallCount()) } func TestCommandPlugin_monitorSubscribeChannel(t *testing.T) { diff --git a/internal/command/command_service.go b/internal/command/command_service.go index a242b92a2..149450c7e 100644 --- a/internal/command/command_service.go +++ b/internal/command/command_service.go @@ -182,6 +182,32 @@ func (cs *CommandService) SendDataPlaneResponse(ctx context.Context, response *m ) } +func (cs *CommandService) UpdateAgentConfiguration(ctx context.Context, mpiConfig *mpi.AgentConfig) error { + if !cs.isConnected.Load() { + return errors.New("command service client not connected yet") + } + slog.DebugContext(ctx, "Updating agent configuration", "config", mpiConfig) + + if mpiConfig.Log != nil { + slog.DebugContext(ctx, "Updating log configuration", "log", mpiConfig.Log) + logConf := config.Log{ + Level: config.MapConfigLogLevelToSlogLevel(mpiConfig.Log.LogLevel), + Path: mpiConfig.Log.LogPath, + } + cs.agentConfig.Log = &logConf + + // Reinitialize logger with new configuration + slogger := logger.New( + cs.agentConfig.Log.Path, + cs.agentConfig.Log.Level, + ) + slog.SetDefault(slogger) + } + + return nil +} + +// Subscribe to the Management Plane for incoming commands. func (cs *CommandService) Subscribe(ctx context.Context) { commonSettings := &config.BackOff{ InitialInterval: cs.agentConfig.Client.Backoff.InitialInterval, diff --git a/internal/command/command_service_test.go b/internal/command/command_service_test.go index d91e9fe0f..d846a84c0 100644 --- a/internal/command/command_service_test.go +++ b/internal/command/command_service_test.go @@ -377,6 +377,39 @@ func TestCommandService_SendDataPlaneResponse_configApplyRequest(t *testing.T) { wg.Wait() } +func TestCommandService_UpdateAgentConfiguration(t *testing.T) { + ctx := context.Background() + commandServiceClient := &v1fakes.FakeCommandServiceClient{} + + initialConfig := types.AgentConfig() + initialConfig.Log.Level = "INFO" + initialConfig.Log.Path = "" + + commandService := NewCommandService( + commandServiceClient, + initialConfig, + make(chan *mpi.ManagementPlaneRequest), + ) + commandService.isConnected.Store(true) + + originalLogger := slog.Default() + + updatedConfig := &mpi.AgentConfig{ + Log: &mpi.Log{ + LogLevel: mpi.Log_LOG_LEVEL_DEBUG, + LogPath: "/etc/nginx-agent", + }, + } + + err := commandService.UpdateAgentConfiguration(ctx, updatedConfig) + require.NoError(t, err) + require.Equal(t, "DEBUG", commandService.agentConfig.Log.Level) + require.Equal(t, "/etc/nginx-agent", commandService.agentConfig.Log.Path) + + updatedLogger := slog.Default() + require.NotEqual(t, originalLogger, updatedLogger) +} + func TestCommandService_isValidRequest(t *testing.T) { ctx := context.Background() commandServiceClient := &v1fakes.FakeCommandServiceClient{} diff --git a/internal/command/commandfakes/fake_command_service.go b/internal/command/commandfakes/fake_command_service.go index 5d8fda386..ff0f6c70e 100644 --- a/internal/command/commandfakes/fake_command_service.go +++ b/internal/command/commandfakes/fake_command_service.go @@ -50,6 +50,18 @@ type FakeCommandService struct { subscribeArgsForCall []struct { arg1 context.Context } + UpdateAgentConfigurationStub func(context.Context, *v1.AgentConfig) error + updateAgentConfigurationMutex sync.RWMutex + updateAgentConfigurationArgsForCall []struct { + arg1 context.Context + arg2 *v1.AgentConfig + } + updateAgentConfigurationReturns struct { + result1 error + } + updateAgentConfigurationReturnsOnCall map[int]struct { + result1 error + } UpdateClientStub func(context.Context, v1.CommandServiceClient) error updateClientMutex sync.RWMutex updateClientArgsForCall []struct { @@ -302,6 +314,68 @@ func (fake *FakeCommandService) SubscribeArgsForCall(i int) context.Context { return argsForCall.arg1 } +func (fake *FakeCommandService) UpdateAgentConfiguration(arg1 context.Context, arg2 *v1.AgentConfig) error { + fake.updateAgentConfigurationMutex.Lock() + ret, specificReturn := fake.updateAgentConfigurationReturnsOnCall[len(fake.updateAgentConfigurationArgsForCall)] + fake.updateAgentConfigurationArgsForCall = append(fake.updateAgentConfigurationArgsForCall, struct { + arg1 context.Context + arg2 *v1.AgentConfig + }{arg1, arg2}) + stub := fake.UpdateAgentConfigurationStub + fakeReturns := fake.updateAgentConfigurationReturns + fake.recordInvocation("UpdateAgentConfiguration", []interface{}{arg1, arg2}) + fake.updateAgentConfigurationMutex.Unlock() + if stub != nil { + return stub(arg1, arg2) + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeCommandService) UpdateAgentConfigurationCallCount() int { + fake.updateAgentConfigurationMutex.RLock() + defer fake.updateAgentConfigurationMutex.RUnlock() + return len(fake.updateAgentConfigurationArgsForCall) +} + +func (fake *FakeCommandService) UpdateAgentConfigurationCalls(stub func(context.Context, *v1.AgentConfig) error) { + fake.updateAgentConfigurationMutex.Lock() + defer fake.updateAgentConfigurationMutex.Unlock() + fake.UpdateAgentConfigurationStub = stub +} + +func (fake *FakeCommandService) UpdateAgentConfigurationArgsForCall(i int) (context.Context, *v1.AgentConfig) { + fake.updateAgentConfigurationMutex.RLock() + defer fake.updateAgentConfigurationMutex.RUnlock() + argsForCall := fake.updateAgentConfigurationArgsForCall[i] + return argsForCall.arg1, argsForCall.arg2 +} + +func (fake *FakeCommandService) UpdateAgentConfigurationReturns(result1 error) { + fake.updateAgentConfigurationMutex.Lock() + defer fake.updateAgentConfigurationMutex.Unlock() + fake.UpdateAgentConfigurationStub = nil + fake.updateAgentConfigurationReturns = struct { + result1 error + }{result1} +} + +func (fake *FakeCommandService) UpdateAgentConfigurationReturnsOnCall(i int, result1 error) { + fake.updateAgentConfigurationMutex.Lock() + defer fake.updateAgentConfigurationMutex.Unlock() + fake.UpdateAgentConfigurationStub = nil + if fake.updateAgentConfigurationReturnsOnCall == nil { + fake.updateAgentConfigurationReturnsOnCall = make(map[int]struct { + result1 error + }) + } + fake.updateAgentConfigurationReturnsOnCall[i] = struct { + result1 error + }{result1} +} + func (fake *FakeCommandService) UpdateClient(arg1 context.Context, arg2 v1.CommandServiceClient) error { fake.updateClientMutex.Lock() ret, specificReturn := fake.updateClientReturnsOnCall[len(fake.updateClientArgsForCall)] @@ -504,6 +578,8 @@ func (fake *FakeCommandService) Invocations() map[string][][]interface{} { defer fake.sendDataPlaneResponseMutex.RUnlock() fake.subscribeMutex.RLock() defer fake.subscribeMutex.RUnlock() + fake.updateAgentConfigurationMutex.RLock() + defer fake.updateAgentConfigurationMutex.RUnlock() fake.updateClientMutex.RLock() defer fake.updateClientMutex.RUnlock() fake.updateDataPlaneHealthMutex.RLock() diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 1c15f8b98..3c4c8ad53 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -1014,7 +1014,9 @@ func agentConfig() *Config { UUID: "", Version: "", Path: "", - Log: &Log{}, + Log: &Log{ + Level: "info", + }, Client: &Client{ HTTP: &HTTP{ Timeout: 10 * time.Second, diff --git a/internal/config/mapper.go b/internal/config/mapper.go index c51b1a810..ea8f6d82f 100644 --- a/internal/config/mapper.go +++ b/internal/config/mapper.go @@ -122,3 +122,49 @@ func ToAuxiliaryCommandServerProto(cmd *Command) *mpi.AuxiliaryCommandServer { return protoConfig } + +func FromAgentConfigLogProto(mpiConfig *mpi.AgentConfig) *Log { + return &Log{ + Level: MapConfigLogLevelToSlogLevel(mpiConfig.GetLog().GetLogLevel()), + Path: mpiConfig.Log.GetLogPath(), + } +} + +func ToAgentConfigLogProto(agentLogConfig *Log) *mpi.Log { + return &mpi.Log{ + LogLevel: MapSlogLevelToConfigLogLevel(agentLogConfig.Level), + LogPath: agentLogConfig.Path, + } +} + +func MapConfigLogLevelToSlogLevel(level mpi.Log_LogLevel) string { + switch level { + case mpi.Log_LOG_LEVEL_DEBUG: + return "DEBUG" + case mpi.Log_LOG_LEVEL_INFO: + return "INFO" + case mpi.Log_LOG_LEVEL_WARN: + return "WARN" + case mpi.Log_LOG_LEVEL_ERROR: + return "ERROR" + case mpi.Log_LOG_LEVEL_UNSPECIFIED: + fallthrough + default: + return "INFO" + } +} + +func MapSlogLevelToConfigLogLevel(level string) mpi.Log_LogLevel { + switch level { + case "DEBUG": + return mpi.Log_LOG_LEVEL_DEBUG + case "INFO": + return mpi.Log_LOG_LEVEL_INFO + case "WARN": + return mpi.Log_LOG_LEVEL_WARN + case "ERROR": + return mpi.Log_LOG_LEVEL_ERROR + default: + return mpi.Log_LOG_LEVEL_UNSPECIFIED + } +} diff --git a/internal/config/mapper_test.go b/internal/config/mapper_test.go index 6217ed3dd..ed949ad18 100644 --- a/internal/config/mapper_test.go +++ b/internal/config/mapper_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestFromCommandProto(t *testing.T) { +func TestMapper_FromCommandProto(t *testing.T) { tests := []struct { protoConfig *mpi.CommandServer expected *Command @@ -115,7 +115,7 @@ func TestFromCommandProto(t *testing.T) { } } -func TestToCommandProto(t *testing.T) { +func TestMapper_ToCommandProto(t *testing.T) { tests := []struct { cmd *Command expected *mpi.CommandServer @@ -219,3 +219,113 @@ func TestToCommandProto(t *testing.T) { }) } } + +func TestMapper_ToAgentConfigLogProto(t *testing.T) { + tests := []struct { + log *Log + expected *mpi.Log + name string + }{ + { + name: "Test 1: Log level DEBUG", + log: &Log{ + Level: "DEBUG", + }, + expected: &mpi.Log{ + LogLevel: mpi.Log_LOG_LEVEL_DEBUG, + LogPath: "", + }, + }, + { + name: "Test 2: Log level INFO", + log: &Log{ + Level: "INFO", + }, + expected: &mpi.Log{ + LogLevel: mpi.Log_LOG_LEVEL_INFO, + LogPath: "", + }, + }, + { + name: "Test 3: Log level WARN", + log: &Log{ + Level: "WARN", + }, + expected: &mpi.Log{ + LogLevel: mpi.Log_LOG_LEVEL_WARN, + LogPath: "", + }, + }, + { + name: "Test 4: Log level ERROR", + log: &Log{ + Level: "ERROR", + }, + expected: &mpi.Log{ + LogLevel: mpi.Log_LOG_LEVEL_ERROR, + LogPath: "", + }, + }, + { + name: "Test 5: Log level UNKNOWN", + log: &Log{ + Level: "UNKNOWN", + }, + expected: &mpi.Log{ + LogLevel: mpi.Log_LOG_LEVEL_UNSPECIFIED, + LogPath: "", + }, + }, + { + name: "Test 6: Log level empty", + log: &Log{ + Level: "", + }, + expected: &mpi.Log{ + LogLevel: mpi.Log_LOG_LEVEL_UNSPECIFIED, + LogPath: "", + }, + }, + { + name: "Test 7: Log path set", + log: &Log{ + Level: "INFO", + Path: "/path/to/agent.log", + }, + expected: &mpi.Log{ + LogLevel: mpi.Log_LOG_LEVEL_INFO, + LogPath: "/path/to/agent.log", + }, + }, + { + name: "Test 8: Log path empty", + log: &Log{ + Level: "INFO", + Path: "", + }, + expected: &mpi.Log{ + LogLevel: mpi.Log_LOG_LEVEL_INFO, + LogPath: "", + }, + }, + { + name: "Test 9: Both log level and path set", + log: &Log{ + Level: "DEBUG", + Path: "/other/path/to/agent.log", + }, + expected: &mpi.Log{ + LogLevel: mpi.Log_LOG_LEVEL_DEBUG, + LogPath: "/other/path/to/agent.log", + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + protoLog := ToAgentConfigLogProto(tt.log) + assert.Equal(t, tt.expected.LogLevel, protoLog.LogLevel) + assert.Equal(t, tt.expected.LogPath, protoLog.LogPath) + }) + } +} diff --git a/test/protos/management_plane_request.go b/test/protos/management_plane_request.go index d128f1010..d9b37fffa 100644 --- a/test/protos/management_plane_request.go +++ b/test/protos/management_plane_request.go @@ -123,3 +123,14 @@ func CreateAPIActionRequestNginxPlusUpdateStreamServers(upstream, instanceID str }, } } + +func CreateAgentConfigurationUpdateRequest(config *mpi.AgentConfig) *mpi.ManagementPlaneRequest { + return &mpi.ManagementPlaneRequest{ + MessageMeta: CreateMessageMeta(), + Request: &mpi.ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest{ + UpdateNginxAgentConfigurationRequest: &mpi.UpdateNginxAgentConfigurationRequest{ + AgentConfig: config, + }, + }, + } +} From a8cb72b8eadd8085a7649934fcb76381190995f0 Mon Sep 17 00:00:00 2001 From: Donal Hurley Date: Mon, 10 Nov 2025 16:18:47 +0000 Subject: [PATCH 2/7] Add support for remotely configuring the log level and path --- internal/collector/otel_collector_plugin.go | 14 +++ internal/command/command_plugin.go | 84 ++++++++++----- internal/command/command_plugin_test.go | 30 +++--- internal/command/command_service.go | 25 ++--- internal/command/command_service_test.go | 6 +- .../commandfakes/fake_command_service.go | 102 +++++++++--------- internal/config/config_test.go | 2 +- internal/config/mapper.go | 26 ++--- internal/config/mapper_test.go | 10 +- internal/file/file_plugin.go | 15 +++ internal/file/file_plugin_test.go | 1 + internal/resource/resource_plugin.go | 14 +++ internal/resource/resource_plugin_test.go | 1 + .../instance/instance_watcher_service.go | 1 + internal/watcher/watcher_plugin.go | 14 +++ internal/watcher/watcher_plugin_test.go | 1 + .../grpc_management_plane_api_test.go | 34 ++++++ 17 files changed, 260 insertions(+), 120 deletions(-) diff --git a/internal/collector/otel_collector_plugin.go b/internal/collector/otel_collector_plugin.go index b57696a5f..e102b9328 100644 --- a/internal/collector/otel_collector_plugin.go +++ b/internal/collector/otel_collector_plugin.go @@ -192,6 +192,8 @@ func (oc *Collector) Process(ctx context.Context, msg *bus.Message) { oc.handleNginxConfigUpdate(ctx, msg) case bus.ResourceUpdateTopic: oc.handleResourceUpdate(ctx, msg) + case bus.AgentConfigUpdateTopic: + oc.handleAgentConfigUpdate(ctx, msg) default: slog.DebugContext(ctx, "OTel collector plugin unknown topic", "topic", msg.Topic) } @@ -202,6 +204,7 @@ func (oc *Collector) Subscriptions() []string { return []string{ bus.ResourceUpdateTopic, bus.NginxConfigUpdateTopic, + bus.AgentConfigUpdateTopic, } } @@ -329,6 +332,17 @@ func (oc *Collector) handleResourceUpdate(ctx context.Context, msg *bus.Message) } } +func (oc *Collector) handleAgentConfigUpdate(ctx context.Context, msg *bus.Message) { + slog.DebugContext(ctx, "OTel collector plugin received agent config update message") + agentConfig, ok := msg.Data.(*config.Config) + if !ok { + slog.ErrorContext(ctx, "Unable to cast message payload to *config.Config", "payload", msg.Data) + return + } + + oc.config = agentConfig +} + func (oc *Collector) updateResourceProcessor(resourceUpdateContext *v1.Resource) bool { resourceProcessorUpdated := false diff --git a/internal/command/command_plugin.go b/internal/command/command_plugin.go index 9673d1b21..6c32a8a57 100644 --- a/internal/command/command_plugin.go +++ b/internal/command/command_plugin.go @@ -37,7 +37,7 @@ type ( Subscribe(ctx context.Context) IsConnected() bool CreateConnection(ctx context.Context, resource *mpi.Resource) (*mpi.CreateConnectionResponse, error) - UpdateAgentConfiguration(ctx context.Context, request *mpi.AgentConfig) error + UpdateAgentConfig(ctx context.Context, request *mpi.AgentConfig) (*config.Config, error) } CommandPlugin struct { @@ -128,8 +128,6 @@ func (cp *CommandPlugin) Process(ctx context.Context, msg *bus.Message) { cp.processDataPlaneHealth(ctxWithMetadata, msg) case bus.DataPlaneResponseTopic: cp.processDataPlaneResponse(ctxWithMetadata, msg) - case bus.AgentConfigUpdateTopic: - cp.processAgentConfigUpdate(ctxWithMetadata, msg) default: slog.DebugContext(ctxWithMetadata, "Command plugin received unknown topic", "topic", msg.Topic) } @@ -143,7 +141,6 @@ func (cp *CommandPlugin) Subscriptions() []string { bus.InstanceHealthTopic, bus.DataPlaneHealthResponseTopic, bus.DataPlaneResponseTopic, - bus.AgentConfigUpdateTopic, } } @@ -185,12 +182,23 @@ func (cp *CommandPlugin) createConnection(ctx context.Context, resource *mpi.Res Data: createConnectionResponse, }) - // update agent configuration after connection is created, and notify other plugins - _ = cp.commandService.UpdateAgentConfiguration(ctx, createConnectionResponse.AgentConfig) - cp.messagePipe.Process(ctx, &bus.Message{ - Topic: bus.AgentConfigUpdateTopic, - Data: createConnectionResponse.AgentConfig, - }) + if createConnectionResponse.GetAgentConfig() != nil { + newAgentConfig, updateConfigError := cp.commandService.UpdateAgentConfig( + ctx, + createConnectionResponse.GetAgentConfig(), + ) + if updateConfigError != nil { + slog.ErrorContext(ctx, "Unable to update agent configuration", "error", updateConfigError) + } else { + slog.DebugContext( + ctx, "Notifying other plugins of agent configuration update from create connection response", + ) + cp.messagePipe.Process(ctx, &bus.Message{ + Topic: bus.AgentConfigUpdateTopic, + Data: newAgentConfig, + }) + } + } } } @@ -273,19 +281,6 @@ func (cp *CommandPlugin) processConnectionReset(ctx context.Context, msg *bus.Me } } -func (cp *CommandPlugin) processAgentConfigUpdate(ctx context.Context, msg *bus.Message) { - slog.DebugContext(ctx, "Command plugin received agent config update message", "data", msg.Data) - // - if mpiConf, ok := msg.Data.(*mpi.AgentConfig); ok { - err := cp.commandService.UpdateAgentConfiguration(ctx, mpiConf) - if err != nil { - slog.ErrorContext(ctx, "Unable to update agent configuration", "error", err) - } - } else { - slog.ErrorContext(ctx, "Invalid data for agent config update message", "data", msg.Data) - } -} - //nolint:revive // cognitive complexity is 14 func (cp *CommandPlugin) monitorSubscribeChannel(ctx context.Context) { for { @@ -436,8 +431,47 @@ func (cp *CommandPlugin) handleInvalidRequest(ctx context.Context, } func (cp *CommandPlugin) handleAgentConfigUpdateRequest(ctx context.Context, request *mpi.ManagementPlaneRequest) { - // notify plugins about the agent config update request - cp.Process(ctx, &bus.Message{Topic: bus.AgentConfigUpdateTopic, Data: request}) + newAgentConfig, err := cp.commandService.UpdateAgentConfig( + ctx, + request.GetUpdateNginxAgentConfigurationRequest().GetAgentConfig(), + ) + if err != nil { + slog.ErrorContext(ctx, "Command service was unable to update agent configuration", "error", err) + + responseError := cp.commandService.SendDataPlaneResponse(ctx, &mpi.DataPlaneResponse{ + MessageMeta: &mpi.MessageMeta{ + MessageId: id.GenerateMessageID(), + CorrelationId: request.GetMessageMeta().GetCorrelationId(), + Timestamp: timestamppb.Now(), + }, + CommandResponse: &mpi.CommandResponse{ + Status: mpi.CommandResponse_COMMAND_STATUS_FAILURE, + Message: "Failed to update agent configuration", + }, + }) + + if responseError != nil { + slog.ErrorContext(ctx, "Unable to send data plane response", "error", responseError) + } + } else { + cp.Process(ctx, &bus.Message{Topic: bus.AgentConfigUpdateTopic, Data: newAgentConfig}) + + responseError := cp.commandService.SendDataPlaneResponse(ctx, &mpi.DataPlaneResponse{ + MessageMeta: &mpi.MessageMeta{ + MessageId: id.GenerateMessageID(), + CorrelationId: request.GetMessageMeta().GetCorrelationId(), + Timestamp: timestamppb.Now(), + }, + CommandResponse: &mpi.CommandResponse{ + Status: mpi.CommandResponse_COMMAND_STATUS_OK, + Message: "Successfully updated agent configuration", + }, + }) + + if responseError != nil { + slog.ErrorContext(ctx, "Unable to send data plane response", "error", responseError) + } + } } func (cp *CommandPlugin) createDataPlaneResponse(correlationID string, status mpi.CommandResponse_CommandStatus, diff --git a/internal/command/command_plugin_test.go b/internal/command/command_plugin_test.go index bbe024b40..b6e988753 100644 --- a/internal/command/command_plugin_test.go +++ b/internal/command/command_plugin_test.go @@ -77,8 +77,20 @@ func TestCommandPlugin_Init(t *testing.T) { func TestCommandPlugin_createConnection(t *testing.T) { ctx := context.Background() + response := &mpi.CreateConnectionResponse{ + Response: &mpi.CommandResponse{ + Status: mpi.CommandResponse_COMMAND_STATUS_OK, + Message: "Connection created successfully", + }, + AgentConfig: &mpi.AgentConfig{ + Log: &mpi.Log{ + LogLevel: mpi.Log_LOG_LEVEL_DEBUG, + }, + }, + } + commandService := &commandfakes.FakeCommandService{} - commandService.CreateConnectionReturns(&mpi.CreateConnectionResponse{}, nil) + commandService.CreateConnectionReturns(response, nil) messagePipe := busfakes.NewFakeMessagePipe() commandPlugin := NewCommandPlugin(types.AgentConfig(), &grpcfakes.FakeGrpcConnectionInterface{}, model.Command) @@ -98,14 +110,15 @@ func TestCommandPlugin_createConnection(t *testing.T) { assert.Eventually( t, - func() bool { return len(messagePipe.Messages()) == 1 }, + func() bool { return len(messagePipe.Messages()) == 2 }, 2*time.Second, 10*time.Millisecond, ) messages := messagePipe.Messages() - assert.Len(t, messages, 1) + assert.Len(t, messages, 2) assert.Equal(t, bus.ConnectionCreatedTopic, messages[0].Topic) + assert.Equal(t, bus.AgentConfigUpdateTopic, messages[1].Topic) } func TestCommandPlugin_Process(t *testing.T) { @@ -151,17 +164,6 @@ func TestCommandPlugin_Process(t *testing.T) { Data: commandPlugin.conn, }) require.Equal(t, 1, fakeCommandService.UpdateClientCallCount()) - - commandPlugin.Process(ctx, &bus.Message{ - Topic: bus.AgentConfigUpdateTopic, - Data: mpi.AgentConfig{ - Log: &mpi.Log{ - LogLevel: mpi.Log_LOG_LEVEL_DEBUG, - LogPath: "somewhere", - }, - }, - }) - require.Equal(t, 1, fakeCommandService.UpdateAgentConfigurationCallCount()) } func TestCommandPlugin_monitorSubscribeChannel(t *testing.T) { diff --git a/internal/command/command_service.go b/internal/command/command_service.go index 149450c7e..a196474b7 100644 --- a/internal/command/command_service.go +++ b/internal/command/command_service.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "log/slog" + "reflect" "sync" "sync/atomic" @@ -182,21 +183,21 @@ func (cs *CommandService) SendDataPlaneResponse(ctx context.Context, response *m ) } -func (cs *CommandService) UpdateAgentConfiguration(ctx context.Context, mpiConfig *mpi.AgentConfig) error { +func (cs *CommandService) UpdateAgentConfig( + ctx context.Context, + mpiConfig *mpi.AgentConfig, +) (*config.Config, error) { if !cs.isConnected.Load() { - return errors.New("command service client not connected yet") + return nil, errors.New("command service client not connected yet") } - slog.DebugContext(ctx, "Updating agent configuration", "config", mpiConfig) + slog.InfoContext(ctx, "Updating agent configuration", "config", mpiConfig) - if mpiConfig.Log != nil { - slog.DebugContext(ctx, "Updating log configuration", "log", mpiConfig.Log) - logConf := config.Log{ - Level: config.MapConfigLogLevelToSlogLevel(mpiConfig.Log.LogLevel), - Path: mpiConfig.Log.LogPath, - } - cs.agentConfig.Log = &logConf + updatedLog := config.FromAgentConfigLogProto(mpiConfig.GetLog()) + + if mpiConfig.GetLog() != nil && !reflect.DeepEqual(cs.agentConfig.Log, updatedLog) { + slog.InfoContext(ctx, "Updating log configuration", "log", updatedLog) + cs.agentConfig.Log = updatedLog - // Reinitialize logger with new configuration slogger := logger.New( cs.agentConfig.Log.Path, cs.agentConfig.Log.Level, @@ -204,7 +205,7 @@ func (cs *CommandService) UpdateAgentConfiguration(ctx context.Context, mpiConfi slog.SetDefault(slogger) } - return nil + return cs.agentConfig, nil } // Subscribe to the Management Plane for incoming commands. diff --git a/internal/command/command_service_test.go b/internal/command/command_service_test.go index d846a84c0..a554ac428 100644 --- a/internal/command/command_service_test.go +++ b/internal/command/command_service_test.go @@ -400,11 +400,13 @@ func TestCommandService_UpdateAgentConfiguration(t *testing.T) { LogPath: "/etc/nginx-agent", }, } - - err := commandService.UpdateAgentConfiguration(ctx, updatedConfig) + + newAgentConfig, err := commandService.UpdateAgentConfig(ctx, updatedConfig) require.NoError(t, err) require.Equal(t, "DEBUG", commandService.agentConfig.Log.Level) require.Equal(t, "/etc/nginx-agent", commandService.agentConfig.Log.Path) + require.Equal(t, "DEBUG", newAgentConfig.Log.Level) + require.Equal(t, "/etc/nginx-agent", newAgentConfig.Log.Path) updatedLogger := slog.Default() require.NotEqual(t, originalLogger, updatedLogger) diff --git a/internal/command/commandfakes/fake_command_service.go b/internal/command/commandfakes/fake_command_service.go index ff0f6c70e..21c52824a 100644 --- a/internal/command/commandfakes/fake_command_service.go +++ b/internal/command/commandfakes/fake_command_service.go @@ -6,6 +6,7 @@ import ( "sync" v1 "github.com/nginx/agent/v3/api/grpc/mpi/v1" + "github.com/nginx/agent/v3/internal/config" ) type FakeCommandService struct { @@ -50,17 +51,19 @@ type FakeCommandService struct { subscribeArgsForCall []struct { arg1 context.Context } - UpdateAgentConfigurationStub func(context.Context, *v1.AgentConfig) error - updateAgentConfigurationMutex sync.RWMutex - updateAgentConfigurationArgsForCall []struct { + UpdateAgentConfigStub func(context.Context, *v1.AgentConfig) (*config.Config, error) + updateAgentConfigMutex sync.RWMutex + updateAgentConfigArgsForCall []struct { arg1 context.Context arg2 *v1.AgentConfig } - updateAgentConfigurationReturns struct { - result1 error + updateAgentConfigReturns struct { + result1 *config.Config + result2 error } - updateAgentConfigurationReturnsOnCall map[int]struct { - result1 error + updateAgentConfigReturnsOnCall map[int]struct { + result1 *config.Config + result2 error } UpdateClientStub func(context.Context, v1.CommandServiceClient) error updateClientMutex sync.RWMutex @@ -314,66 +317,69 @@ func (fake *FakeCommandService) SubscribeArgsForCall(i int) context.Context { return argsForCall.arg1 } -func (fake *FakeCommandService) UpdateAgentConfiguration(arg1 context.Context, arg2 *v1.AgentConfig) error { - fake.updateAgentConfigurationMutex.Lock() - ret, specificReturn := fake.updateAgentConfigurationReturnsOnCall[len(fake.updateAgentConfigurationArgsForCall)] - fake.updateAgentConfigurationArgsForCall = append(fake.updateAgentConfigurationArgsForCall, struct { +func (fake *FakeCommandService) UpdateAgentConfig(arg1 context.Context, arg2 *v1.AgentConfig) (*config.Config, error) { + fake.updateAgentConfigMutex.Lock() + ret, specificReturn := fake.updateAgentConfigReturnsOnCall[len(fake.updateAgentConfigArgsForCall)] + fake.updateAgentConfigArgsForCall = append(fake.updateAgentConfigArgsForCall, struct { arg1 context.Context arg2 *v1.AgentConfig }{arg1, arg2}) - stub := fake.UpdateAgentConfigurationStub - fakeReturns := fake.updateAgentConfigurationReturns - fake.recordInvocation("UpdateAgentConfiguration", []interface{}{arg1, arg2}) - fake.updateAgentConfigurationMutex.Unlock() + stub := fake.UpdateAgentConfigStub + fakeReturns := fake.updateAgentConfigReturns + fake.recordInvocation("UpdateAgentConfig", []interface{}{arg1, arg2}) + fake.updateAgentConfigMutex.Unlock() if stub != nil { return stub(arg1, arg2) } if specificReturn { - return ret.result1 + return ret.result1, ret.result2 } - return fakeReturns.result1 + return fakeReturns.result1, fakeReturns.result2 } -func (fake *FakeCommandService) UpdateAgentConfigurationCallCount() int { - fake.updateAgentConfigurationMutex.RLock() - defer fake.updateAgentConfigurationMutex.RUnlock() - return len(fake.updateAgentConfigurationArgsForCall) +func (fake *FakeCommandService) UpdateAgentConfigCallCount() int { + fake.updateAgentConfigMutex.RLock() + defer fake.updateAgentConfigMutex.RUnlock() + return len(fake.updateAgentConfigArgsForCall) } -func (fake *FakeCommandService) UpdateAgentConfigurationCalls(stub func(context.Context, *v1.AgentConfig) error) { - fake.updateAgentConfigurationMutex.Lock() - defer fake.updateAgentConfigurationMutex.Unlock() - fake.UpdateAgentConfigurationStub = stub +func (fake *FakeCommandService) UpdateAgentConfigCalls(stub func(context.Context, *v1.AgentConfig) (*config.Config, error)) { + fake.updateAgentConfigMutex.Lock() + defer fake.updateAgentConfigMutex.Unlock() + fake.UpdateAgentConfigStub = stub } -func (fake *FakeCommandService) UpdateAgentConfigurationArgsForCall(i int) (context.Context, *v1.AgentConfig) { - fake.updateAgentConfigurationMutex.RLock() - defer fake.updateAgentConfigurationMutex.RUnlock() - argsForCall := fake.updateAgentConfigurationArgsForCall[i] +func (fake *FakeCommandService) UpdateAgentConfigArgsForCall(i int) (context.Context, *v1.AgentConfig) { + fake.updateAgentConfigMutex.RLock() + defer fake.updateAgentConfigMutex.RUnlock() + argsForCall := fake.updateAgentConfigArgsForCall[i] return argsForCall.arg1, argsForCall.arg2 } -func (fake *FakeCommandService) UpdateAgentConfigurationReturns(result1 error) { - fake.updateAgentConfigurationMutex.Lock() - defer fake.updateAgentConfigurationMutex.Unlock() - fake.UpdateAgentConfigurationStub = nil - fake.updateAgentConfigurationReturns = struct { - result1 error - }{result1} +func (fake *FakeCommandService) UpdateAgentConfigReturns(result1 *config.Config, result2 error) { + fake.updateAgentConfigMutex.Lock() + defer fake.updateAgentConfigMutex.Unlock() + fake.UpdateAgentConfigStub = nil + fake.updateAgentConfigReturns = struct { + result1 *config.Config + result2 error + }{result1, result2} } -func (fake *FakeCommandService) UpdateAgentConfigurationReturnsOnCall(i int, result1 error) { - fake.updateAgentConfigurationMutex.Lock() - defer fake.updateAgentConfigurationMutex.Unlock() - fake.UpdateAgentConfigurationStub = nil - if fake.updateAgentConfigurationReturnsOnCall == nil { - fake.updateAgentConfigurationReturnsOnCall = make(map[int]struct { - result1 error +func (fake *FakeCommandService) UpdateAgentConfigReturnsOnCall(i int, result1 *config.Config, result2 error) { + fake.updateAgentConfigMutex.Lock() + defer fake.updateAgentConfigMutex.Unlock() + fake.UpdateAgentConfigStub = nil + if fake.updateAgentConfigReturnsOnCall == nil { + fake.updateAgentConfigReturnsOnCall = make(map[int]struct { + result1 *config.Config + result2 error }) } - fake.updateAgentConfigurationReturnsOnCall[i] = struct { - result1 error - }{result1} + fake.updateAgentConfigReturnsOnCall[i] = struct { + result1 *config.Config + result2 error + }{result1, result2} } func (fake *FakeCommandService) UpdateClient(arg1 context.Context, arg2 v1.CommandServiceClient) error { @@ -578,8 +584,8 @@ func (fake *FakeCommandService) Invocations() map[string][][]interface{} { defer fake.sendDataPlaneResponseMutex.RUnlock() fake.subscribeMutex.RLock() defer fake.subscribeMutex.RUnlock() - fake.updateAgentConfigurationMutex.RLock() - defer fake.updateAgentConfigurationMutex.RUnlock() + fake.updateAgentConfigMutex.RLock() + defer fake.updateAgentConfigMutex.RUnlock() fake.updateClientMutex.RLock() defer fake.updateClientMutex.RUnlock() fake.updateDataPlaneHealthMutex.RLock() diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 3c4c8ad53..fb04aceb9 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -1014,7 +1014,7 @@ func agentConfig() *Config { UUID: "", Version: "", Path: "", - Log: &Log{ + Log: &Log{ Level: "info", }, Client: &Client{ diff --git a/internal/config/mapper.go b/internal/config/mapper.go index ea8f6d82f..d47ff7cf1 100644 --- a/internal/config/mapper.go +++ b/internal/config/mapper.go @@ -7,6 +7,7 @@ package config import ( "log/slog" + "strings" mpi "github.com/nginx/agent/v3/api/grpc/mpi/v1" ) @@ -123,10 +124,10 @@ func ToAuxiliaryCommandServerProto(cmd *Command) *mpi.AuxiliaryCommandServer { return protoConfig } -func FromAgentConfigLogProto(mpiConfig *mpi.AgentConfig) *Log { +func FromAgentConfigLogProto(mpiLog *mpi.Log) *Log { return &Log{ - Level: MapConfigLogLevelToSlogLevel(mpiConfig.GetLog().GetLogLevel()), - Path: mpiConfig.Log.GetLogPath(), + Level: MapConfigLogLevelToSlogLevel(mpiLog.GetLogLevel()), + Path: mpiLog.GetLogPath(), } } @@ -138,24 +139,23 @@ func ToAgentConfigLogProto(agentLogConfig *Log) *mpi.Log { } func MapConfigLogLevelToSlogLevel(level mpi.Log_LogLevel) string { + slogLevel := "INFO" + switch level { case mpi.Log_LOG_LEVEL_DEBUG: - return "DEBUG" - case mpi.Log_LOG_LEVEL_INFO: - return "INFO" + slogLevel = "DEBUG" case mpi.Log_LOG_LEVEL_WARN: - return "WARN" + slogLevel = "WARN" case mpi.Log_LOG_LEVEL_ERROR: - return "ERROR" - case mpi.Log_LOG_LEVEL_UNSPECIFIED: - fallthrough - default: - return "INFO" + slogLevel = "ERROR" + case mpi.Log_LOG_LEVEL_INFO, mpi.Log_LOG_LEVEL_UNSPECIFIED: } + + return slogLevel } func MapSlogLevelToConfigLogLevel(level string) mpi.Log_LogLevel { - switch level { + switch strings.ToUpper(level) { case "DEBUG": return mpi.Log_LOG_LEVEL_DEBUG case "INFO": diff --git a/internal/config/mapper_test.go b/internal/config/mapper_test.go index ed949ad18..f220ddcce 100644 --- a/internal/config/mapper_test.go +++ b/internal/config/mapper_test.go @@ -321,11 +321,11 @@ func TestMapper_ToAgentConfigLogProto(t *testing.T) { }, } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - protoLog := ToAgentConfigLogProto(tt.log) - assert.Equal(t, tt.expected.LogLevel, protoLog.LogLevel) - assert.Equal(t, tt.expected.LogPath, protoLog.LogPath) + for _, testCase := range tests { + t.Run(testCase.name, func(t *testing.T) { + protoLog := ToAgentConfigLogProto(testCase.log) + assert.Equal(t, testCase.expected.GetLogLevel(), protoLog.GetLogLevel()) + assert.Equal(t, testCase.expected.GetLogPath(), protoLog.GetLogPath()) }) } } diff --git a/internal/file/file_plugin.go b/internal/file/file_plugin.go index a9747b7b3..4a94eecac 100644 --- a/internal/file/file_plugin.go +++ b/internal/file/file_plugin.go @@ -81,6 +81,7 @@ func (fp *FilePlugin) Info() *bus.Info { } } +//nolint:revive,cyclop // Cyclomatic complexity is acceptable for this function func (fp *FilePlugin) Process(ctx context.Context, msg *bus.Message) { ctxWithMetadata := fp.config.NewContextWithLabels(ctx) @@ -110,6 +111,8 @@ func (fp *FilePlugin) Process(ctx context.Context, msg *bus.Message) { fp.handleReloadSuccess(ctxWithMetadata, msg) case bus.ConfigApplyFailedTopic: fp.handleConfigApplyFailedRequest(ctxWithMetadata, msg) + case bus.AgentConfigUpdateTopic: + fp.handleAgentConfigUpdate(ctxWithMetadata, msg) default: slog.DebugContext(ctxWithMetadata, "File plugin received unknown topic", "topic", msg.Topic) } @@ -135,6 +138,7 @@ func (fp *FilePlugin) Subscriptions() []string { bus.ConfigApplyFailedTopic, bus.ReloadSuccessfulTopic, bus.ConfigApplyCompleteTopic, + bus.AgentConfigUpdateTopic, } } @@ -410,6 +414,17 @@ func (fp *FilePlugin) handleConfigUploadRequest(ctx context.Context, msg *bus.Me fp.messagePipe.Process(ctx, &bus.Message{Topic: bus.DataPlaneResponseTopic, Data: response}) } +func (fp *FilePlugin) handleAgentConfigUpdate(ctx context.Context, msg *bus.Message) { + slog.DebugContext(ctx, "File plugin received agent config update message") + agentConfig, ok := msg.Data.(*config.Config) + if !ok { + slog.ErrorContext(ctx, "Unable to cast message payload to *config.Config", "payload", msg.Data) + return + } + + fp.config = agentConfig +} + func (fp *FilePlugin) createDataPlaneResponse(correlationID string, status mpi.CommandResponse_CommandStatus, message, instanceID, err string, ) *mpi.DataPlaneResponse { diff --git a/internal/file/file_plugin_test.go b/internal/file/file_plugin_test.go index 2955dacf3..74aa6024a 100644 --- a/internal/file/file_plugin_test.go +++ b/internal/file/file_plugin_test.go @@ -61,6 +61,7 @@ func TestFilePlugin_Subscriptions(t *testing.T) { bus.ConfigApplyFailedTopic, bus.ReloadSuccessfulTopic, bus.ConfigApplyCompleteTopic, + bus.AgentConfigUpdateTopic, }, filePlugin.Subscriptions(), ) diff --git a/internal/resource/resource_plugin.go b/internal/resource/resource_plugin.go index 036e817b7..908abed59 100644 --- a/internal/resource/resource_plugin.go +++ b/internal/resource/resource_plugin.go @@ -121,6 +121,8 @@ func (r *Resource) Process(ctx context.Context, msg *bus.Message) { r.handleRollbackWrite(ctx, msg) case bus.APIActionRequestTopic: r.handleAPIActionRequest(ctx, msg) + case bus.AgentConfigUpdateTopic: + r.handleAgentConfigUpdate(ctx, msg) default: slog.DebugContext(ctx, "Unknown topic", "topic", msg.Topic) } @@ -134,6 +136,7 @@ func (*Resource) Subscriptions() []string { bus.WriteConfigSuccessfulTopic, bus.RollbackWriteTopic, bus.APIActionRequestTopic, + bus.AgentConfigUpdateTopic, } } @@ -281,3 +284,14 @@ func (r *Resource) handleRollbackWrite(ctx context.Context, msg *bus.Message) { r.messagePipe.Process(ctx, &bus.Message{Topic: bus.ConfigApplyCompleteTopic, Data: applyResponse}) } + +func (r *Resource) handleAgentConfigUpdate(ctx context.Context, msg *bus.Message) { + slog.DebugContext(ctx, "Resource plugin received agent config update message") + agentConfig, ok := msg.Data.(*config.Config) + if !ok { + slog.ErrorContext(ctx, "Unable to cast message payload to *config.Config", "payload", msg.Data) + return + } + + r.agentConfig = agentConfig +} diff --git a/internal/resource/resource_plugin_test.go b/internal/resource/resource_plugin_test.go index 0a7165b17..df45879f4 100644 --- a/internal/resource/resource_plugin_test.go +++ b/internal/resource/resource_plugin_test.go @@ -845,6 +845,7 @@ func TestResource_Subscriptions(t *testing.T) { bus.WriteConfigSuccessfulTopic, bus.RollbackWriteTopic, bus.APIActionRequestTopic, + bus.AgentConfigUpdateTopic, }, resourcePlugin.Subscriptions()) } diff --git a/internal/watcher/instance/instance_watcher_service.go b/internal/watcher/instance/instance_watcher_service.go index a132e6b9e..4d00ce70b 100644 --- a/internal/watcher/instance/instance_watcher_service.go +++ b/internal/watcher/instance/instance_watcher_service.go @@ -325,6 +325,7 @@ func (iw *InstanceWatcherService) agentInstance(ctx context.Context) *mpi.Instan Labels: labels, Features: iw.agentConfig.Features, MessageBufferSize: "", + Log: config.ToAgentConfigLogProto(iw.agentConfig.Log), }, }, }, diff --git a/internal/watcher/watcher_plugin.go b/internal/watcher/watcher_plugin.go index 834c7283f..769bdc692 100644 --- a/internal/watcher/watcher_plugin.go +++ b/internal/watcher/watcher_plugin.go @@ -144,6 +144,8 @@ func (w *Watcher) Process(ctx context.Context, msg *bus.Message) { w.handleHealthRequest(ctx) case bus.EnableWatchersTopic: w.handleEnableWatchers(ctx, msg) + case bus.AgentConfigUpdateTopic: + w.handleAgentConfigUpdate(ctx, msg) default: slog.DebugContext(ctx, "Watcher plugin unknown topic", "topic", msg.Topic) } @@ -154,6 +156,7 @@ func (*Watcher) Subscriptions() []string { bus.ConfigApplyRequestTopic, bus.DataPlaneHealthRequestTopic, bus.EnableWatchersTopic, + bus.AgentConfigUpdateTopic, } } @@ -314,3 +317,14 @@ func (w *Watcher) handleInstanceUpdates(newCtx context.Context, message instance ) } } + +func (w *Watcher) handleAgentConfigUpdate(ctx context.Context, msg *bus.Message) { + slog.DebugContext(ctx, "Watcher plugin received agent config update message") + agentConfig, ok := msg.Data.(*config.Config) + if !ok { + slog.ErrorContext(ctx, "Unable to cast message payload to *config.Config", "payload", msg.Data) + return + } + + w.agentConfig = agentConfig +} diff --git a/internal/watcher/watcher_plugin_test.go b/internal/watcher/watcher_plugin_test.go index 9331d320c..424009c60 100644 --- a/internal/watcher/watcher_plugin_test.go +++ b/internal/watcher/watcher_plugin_test.go @@ -248,6 +248,7 @@ func TestWatcher_Subscriptions(t *testing.T) { bus.ConfigApplyRequestTopic, bus.DataPlaneHealthRequestTopic, bus.EnableWatchersTopic, + bus.AgentConfigUpdateTopic, }, watcherPlugin.Subscriptions(), ) diff --git a/test/integration/managementplane/grpc_management_plane_api_test.go b/test/integration/managementplane/grpc_management_plane_api_test.go index 1d77485bc..e13ef0f94 100644 --- a/test/integration/managementplane/grpc_management_plane_api_test.go +++ b/test/integration/managementplane/grpc_management_plane_api_test.go @@ -74,3 +74,37 @@ func (s *MPITestSuite) TestGrpc_Test3_DataplaneHealthRequest() { s.Equal("Successfully sent health status update", responses[0].GetCommandResponse().GetMessage()) slog.Info("finished grpc dataplane health request test") } + +func (s *MPITestSuite) TestGrpc_Test4_UpdateNginxAgentConfigurationRequest() { + slog.Info("starting grpc update nginx agent configuration request test") + request := `{ + "message_meta": { + "message_id": "5d0fa83e-351c-4009-90cd-1f2acce2d184", + "correlation_id": "79794c1c-8e91-47c1-a92c-b9a0c3f1a263", + "timestamp": "2023-01-15T01:30:15.01Z" + }, + "update_nginx_agent_configuration_request": { + "agent_config": { + "log": { + "log_level": 4 + } + } + } + }` + + client := resty.New() + client.SetRetryCount(utils.RetryCount).SetRetryWaitTime(utils.RetryWaitTime).SetRetryMaxWaitTime( + utils.RetryMaxWaitTime) + + url := fmt.Sprintf("http://%s/api/v1/requests", utils.MockManagementPlaneAPIAddress) + resp, err := client.R().EnableTrace().SetBody(request).Post(url) + + s.Require().NoError(err) + s.Equal(http.StatusOK, resp.StatusCode()) + + responses := utils.ManagementPlaneResponses(s.T(), 1, utils.MockManagementPlaneAPIAddress) + + s.Equal(mpi.CommandResponse_COMMAND_STATUS_OK, responses[0].GetCommandResponse().GetStatus()) + s.Equal("Successfully updated agent configuration", responses[0].GetCommandResponse().GetMessage()) + slog.Info("finished grpc update nginx agent configuration request test") +} From 204e19c0a4537027297ddcfc1da82b2b439589ca Mon Sep 17 00:00:00 2001 From: Donal Hurley Date: Tue, 11 Nov 2025 14:30:12 +0000 Subject: [PATCH 3/7] Clean up --- api/grpc/mpi/v1/command.pb.go | 599 +++++++++----------- api/grpc/mpi/v1/command.pb.validate.go | 219 ++----- api/grpc/mpi/v1/command.proto | 21 +- docs/proto/protos.md | 57 +- internal/collector/otel_collector_plugin.go | 5 + internal/command/command_plugin.go | 20 +- internal/command/command_plugin_test.go | 51 +- internal/command/command_service.go | 3 - internal/config/mapper.go | 18 +- internal/config/mapper_test.go | 26 +- internal/file/file_plugin.go | 5 + internal/resource/resource_plugin.go | 12 +- internal/watcher/watcher_plugin.go | 5 + test/protos/management_plane_request.go | 4 +- 14 files changed, 431 insertions(+), 614 deletions(-) diff --git a/api/grpc/mpi/v1/command.pb.go b/api/grpc/mpi/v1/command.pb.go index d135f09f6..dddaa6b8b 100644 --- a/api/grpc/mpi/v1/command.pb.go +++ b/api/grpc/mpi/v1/command.pb.go @@ -85,7 +85,7 @@ func (x InstanceHealth_InstanceHealthStatus) Number() protoreflect.EnumNumber { // Deprecated: Use InstanceHealth_InstanceHealthStatus.Descriptor instead. func (InstanceHealth_InstanceHealthStatus) EnumDescriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{10, 0} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{9, 0} } // the types of instances possible @@ -150,39 +150,35 @@ func (x InstanceMeta_InstanceType) Number() protoreflect.EnumNumber { // Deprecated: Use InstanceMeta_InstanceType.Descriptor instead. func (InstanceMeta_InstanceType) EnumDescriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{28, 0} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{27, 0} } type Log_LogLevel int32 const ( - // Unspecified log level - Log_LOG_LEVEL_UNSPECIFIED Log_LogLevel = 0 + // Info log level + Log_LOG_LEVEL_INFO Log_LogLevel = 0 // Error log level Log_LOG_LEVEL_ERROR Log_LogLevel = 1 // Warning log level Log_LOG_LEVEL_WARN Log_LogLevel = 2 - // Info log level - Log_LOG_LEVEL_INFO Log_LogLevel = 3 // Debug log level - Log_LOG_LEVEL_DEBUG Log_LogLevel = 4 + Log_LOG_LEVEL_DEBUG Log_LogLevel = 3 ) // Enum value maps for Log_LogLevel. var ( Log_LogLevel_name = map[int32]string{ - 0: "LOG_LEVEL_UNSPECIFIED", + 0: "LOG_LEVEL_INFO", 1: "LOG_LEVEL_ERROR", 2: "LOG_LEVEL_WARN", - 3: "LOG_LEVEL_INFO", - 4: "LOG_LEVEL_DEBUG", + 3: "LOG_LEVEL_DEBUG", } Log_LogLevel_value = map[string]int32{ - "LOG_LEVEL_UNSPECIFIED": 0, - "LOG_LEVEL_ERROR": 1, - "LOG_LEVEL_WARN": 2, - "LOG_LEVEL_INFO": 3, - "LOG_LEVEL_DEBUG": 4, + "LOG_LEVEL_INFO": 0, + "LOG_LEVEL_ERROR": 1, + "LOG_LEVEL_WARN": 2, + "LOG_LEVEL_DEBUG": 3, } ) @@ -210,7 +206,7 @@ func (x Log_LogLevel) Number() protoreflect.EnumNumber { // Deprecated: Use Log_LogLevel.Descriptor instead. func (Log_LogLevel) EnumDescriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{38, 0} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{37, 0} } // The connection request is an initial handshake to establish a connection, sending NGINX Agent instance information @@ -730,30 +726,30 @@ func (*UpdateDataPlaneStatusResponse) Descriptor() ([]byte, []int) { return file_mpi_v1_command_proto_rawDescGZIP(), []int{7} } -type UpdateNginxAgentConfigurationRequest struct { +type UpdateAgentConfigRequest struct { state protoimpl.MessageState `protogen:"open.v1"` // Meta-information associated with a message MessageMeta *MessageMeta `protobuf:"bytes,1,opt,name=message_meta,json=messageMeta,proto3" json:"message_meta,omitempty"` - // the NGINX Agent configuration to update + // The NGINX Agent configuration to update AgentConfig *AgentConfig `protobuf:"bytes,2,opt,name=agent_config,json=agentConfig,proto3" json:"agent_config,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *UpdateNginxAgentConfigurationRequest) Reset() { - *x = UpdateNginxAgentConfigurationRequest{} +func (x *UpdateAgentConfigRequest) Reset() { + *x = UpdateAgentConfigRequest{} mi := &file_mpi_v1_command_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *UpdateNginxAgentConfigurationRequest) String() string { +func (x *UpdateAgentConfigRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateNginxAgentConfigurationRequest) ProtoMessage() {} +func (*UpdateAgentConfigRequest) ProtoMessage() {} -func (x *UpdateNginxAgentConfigurationRequest) ProtoReflect() protoreflect.Message { +func (x *UpdateAgentConfigRequest) ProtoReflect() protoreflect.Message { mi := &file_mpi_v1_command_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -765,70 +761,25 @@ func (x *UpdateNginxAgentConfigurationRequest) ProtoReflect() protoreflect.Messa return mi.MessageOf(x) } -// Deprecated: Use UpdateNginxAgentConfigurationRequest.ProtoReflect.Descriptor instead. -func (*UpdateNginxAgentConfigurationRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use UpdateAgentConfigRequest.ProtoReflect.Descriptor instead. +func (*UpdateAgentConfigRequest) Descriptor() ([]byte, []int) { return file_mpi_v1_command_proto_rawDescGZIP(), []int{8} } -func (x *UpdateNginxAgentConfigurationRequest) GetMessageMeta() *MessageMeta { +func (x *UpdateAgentConfigRequest) GetMessageMeta() *MessageMeta { if x != nil { return x.MessageMeta } return nil } -func (x *UpdateNginxAgentConfigurationRequest) GetAgentConfig() *AgentConfig { +func (x *UpdateAgentConfigRequest) GetAgentConfig() *AgentConfig { if x != nil { return x.AgentConfig } return nil } -type UpdateNginxAgentConfigurationResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The success or failure of the UpdateNginxAgentConfigurationRequest - Response *CommandResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateNginxAgentConfigurationResponse) Reset() { - *x = UpdateNginxAgentConfigurationResponse{} - mi := &file_mpi_v1_command_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateNginxAgentConfigurationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNginxAgentConfigurationResponse) ProtoMessage() {} - -func (x *UpdateNginxAgentConfigurationResponse) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateNginxAgentConfigurationResponse.ProtoReflect.Descriptor instead. -func (*UpdateNginxAgentConfigurationResponse) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{9} -} - -func (x *UpdateNginxAgentConfigurationResponse) GetResponse() *CommandResponse { - if x != nil { - return x.Response - } - return nil -} - type InstanceHealth struct { state protoimpl.MessageState `protogen:"open.v1"` InstanceId string `protobuf:"bytes,1,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` @@ -842,7 +793,7 @@ type InstanceHealth struct { func (x *InstanceHealth) Reset() { *x = InstanceHealth{} - mi := &file_mpi_v1_command_proto_msgTypes[10] + mi := &file_mpi_v1_command_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -854,7 +805,7 @@ func (x *InstanceHealth) String() string { func (*InstanceHealth) ProtoMessage() {} func (x *InstanceHealth) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[10] + mi := &file_mpi_v1_command_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -867,7 +818,7 @@ func (x *InstanceHealth) ProtoReflect() protoreflect.Message { // Deprecated: Use InstanceHealth.ProtoReflect.Descriptor instead. func (*InstanceHealth) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{10} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{9} } func (x *InstanceHealth) GetInstanceId() string { @@ -904,7 +855,7 @@ type UpdateDataPlaneHealthRequest struct { func (x *UpdateDataPlaneHealthRequest) Reset() { *x = UpdateDataPlaneHealthRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[11] + mi := &file_mpi_v1_command_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -916,7 +867,7 @@ func (x *UpdateDataPlaneHealthRequest) String() string { func (*UpdateDataPlaneHealthRequest) ProtoMessage() {} func (x *UpdateDataPlaneHealthRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[11] + mi := &file_mpi_v1_command_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -929,7 +880,7 @@ func (x *UpdateDataPlaneHealthRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateDataPlaneHealthRequest.ProtoReflect.Descriptor instead. func (*UpdateDataPlaneHealthRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{11} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{10} } func (x *UpdateDataPlaneHealthRequest) GetMessageMeta() *MessageMeta { @@ -955,7 +906,7 @@ type UpdateDataPlaneHealthResponse struct { func (x *UpdateDataPlaneHealthResponse) Reset() { *x = UpdateDataPlaneHealthResponse{} - mi := &file_mpi_v1_command_proto_msgTypes[12] + mi := &file_mpi_v1_command_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -967,7 +918,7 @@ func (x *UpdateDataPlaneHealthResponse) String() string { func (*UpdateDataPlaneHealthResponse) ProtoMessage() {} func (x *UpdateDataPlaneHealthResponse) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[12] + mi := &file_mpi_v1_command_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -980,7 +931,7 @@ func (x *UpdateDataPlaneHealthResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateDataPlaneHealthResponse.ProtoReflect.Descriptor instead. func (*UpdateDataPlaneHealthResponse) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{12} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{11} } // Reports the status of an associated command. This may be in response to a ManagementPlaneRequest @@ -998,7 +949,7 @@ type DataPlaneResponse struct { func (x *DataPlaneResponse) Reset() { *x = DataPlaneResponse{} - mi := &file_mpi_v1_command_proto_msgTypes[13] + mi := &file_mpi_v1_command_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1010,7 +961,7 @@ func (x *DataPlaneResponse) String() string { func (*DataPlaneResponse) ProtoMessage() {} func (x *DataPlaneResponse) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[13] + mi := &file_mpi_v1_command_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1023,7 +974,7 @@ func (x *DataPlaneResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DataPlaneResponse.ProtoReflect.Descriptor instead. func (*DataPlaneResponse) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{13} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{12} } func (x *DataPlaneResponse) GetMessageMeta() *MessageMeta { @@ -1060,7 +1011,7 @@ type ManagementPlaneRequest struct { // *ManagementPlaneRequest_ConfigUploadRequest // *ManagementPlaneRequest_ActionRequest // *ManagementPlaneRequest_CommandStatusRequest - // *ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest + // *ManagementPlaneRequest_UpdateAgentConfigRequest Request isManagementPlaneRequest_Request `protobuf_oneof:"request"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -1068,7 +1019,7 @@ type ManagementPlaneRequest struct { func (x *ManagementPlaneRequest) Reset() { *x = ManagementPlaneRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[14] + mi := &file_mpi_v1_command_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1080,7 +1031,7 @@ func (x *ManagementPlaneRequest) String() string { func (*ManagementPlaneRequest) ProtoMessage() {} func (x *ManagementPlaneRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[14] + mi := &file_mpi_v1_command_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1093,7 +1044,7 @@ func (x *ManagementPlaneRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ManagementPlaneRequest.ProtoReflect.Descriptor instead. func (*ManagementPlaneRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{14} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{13} } func (x *ManagementPlaneRequest) GetMessageMeta() *MessageMeta { @@ -1164,10 +1115,10 @@ func (x *ManagementPlaneRequest) GetCommandStatusRequest() *CommandStatusRequest return nil } -func (x *ManagementPlaneRequest) GetUpdateNginxAgentConfigurationRequest() *UpdateNginxAgentConfigurationRequest { +func (x *ManagementPlaneRequest) GetUpdateAgentConfigRequest() *UpdateAgentConfigRequest { if x != nil { - if x, ok := x.Request.(*ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest); ok { - return x.UpdateNginxAgentConfigurationRequest + if x, ok := x.Request.(*ManagementPlaneRequest_UpdateAgentConfigRequest); ok { + return x.UpdateAgentConfigRequest } } return nil @@ -1208,9 +1159,9 @@ type ManagementPlaneRequest_CommandStatusRequest struct { CommandStatusRequest *CommandStatusRequest `protobuf:"bytes,8,opt,name=command_status_request,json=commandStatusRequest,proto3,oneof"` } -type ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest struct { - // triggers an UpdateNginxAgentConfiguration rpc, returning an UpdateNginxAgentConfigurationResponse - UpdateNginxAgentConfigurationRequest *UpdateNginxAgentConfigurationRequest `protobuf:"bytes,9,opt,name=update_nginx_agent_configuration_request,json=updateNginxAgentConfigurationRequest,proto3,oneof"` +type ManagementPlaneRequest_UpdateAgentConfigRequest struct { + // triggers an update to the NGINX Agent configuration + UpdateAgentConfigRequest *UpdateAgentConfigRequest `protobuf:"bytes,9,opt,name=update_agent_config_request,json=updateAgentConfigRequest,proto3,oneof"` } func (*ManagementPlaneRequest_StatusRequest) isManagementPlaneRequest_Request() {} @@ -1225,8 +1176,7 @@ func (*ManagementPlaneRequest_ActionRequest) isManagementPlaneRequest_Request() func (*ManagementPlaneRequest_CommandStatusRequest) isManagementPlaneRequest_Request() {} -func (*ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest) isManagementPlaneRequest_Request() { -} +func (*ManagementPlaneRequest_UpdateAgentConfigRequest) isManagementPlaneRequest_Request() {} // Additional information associated with a StatusRequest type StatusRequest struct { @@ -1237,7 +1187,7 @@ type StatusRequest struct { func (x *StatusRequest) Reset() { *x = StatusRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[15] + mi := &file_mpi_v1_command_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1249,7 +1199,7 @@ func (x *StatusRequest) String() string { func (*StatusRequest) ProtoMessage() {} func (x *StatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[15] + mi := &file_mpi_v1_command_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1262,7 +1212,7 @@ func (x *StatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. func (*StatusRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{15} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{14} } // Additional information associated with a HealthRequest @@ -1274,7 +1224,7 @@ type HealthRequest struct { func (x *HealthRequest) Reset() { *x = HealthRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[16] + mi := &file_mpi_v1_command_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1286,7 +1236,7 @@ func (x *HealthRequest) String() string { func (*HealthRequest) ProtoMessage() {} func (x *HealthRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[16] + mi := &file_mpi_v1_command_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1299,7 +1249,7 @@ func (x *HealthRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use HealthRequest.ProtoReflect.Descriptor instead. func (*HealthRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{16} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{15} } // Additional information associated with a ConfigApplyRequest @@ -1313,7 +1263,7 @@ type ConfigApplyRequest struct { func (x *ConfigApplyRequest) Reset() { *x = ConfigApplyRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[17] + mi := &file_mpi_v1_command_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1325,7 +1275,7 @@ func (x *ConfigApplyRequest) String() string { func (*ConfigApplyRequest) ProtoMessage() {} func (x *ConfigApplyRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[17] + mi := &file_mpi_v1_command_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1338,7 +1288,7 @@ func (x *ConfigApplyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfigApplyRequest.ProtoReflect.Descriptor instead. func (*ConfigApplyRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{17} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{16} } func (x *ConfigApplyRequest) GetOverview() *FileOverview { @@ -1359,7 +1309,7 @@ type ConfigUploadRequest struct { func (x *ConfigUploadRequest) Reset() { *x = ConfigUploadRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[18] + mi := &file_mpi_v1_command_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1371,7 +1321,7 @@ func (x *ConfigUploadRequest) String() string { func (*ConfigUploadRequest) ProtoMessage() {} func (x *ConfigUploadRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[18] + mi := &file_mpi_v1_command_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1384,7 +1334,7 @@ func (x *ConfigUploadRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfigUploadRequest.ProtoReflect.Descriptor instead. func (*ConfigUploadRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{18} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{17} } func (x *ConfigUploadRequest) GetOverview() *FileOverview { @@ -1411,7 +1361,7 @@ type APIActionRequest struct { func (x *APIActionRequest) Reset() { *x = APIActionRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[19] + mi := &file_mpi_v1_command_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1423,7 +1373,7 @@ func (x *APIActionRequest) String() string { func (*APIActionRequest) ProtoMessage() {} func (x *APIActionRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[19] + mi := &file_mpi_v1_command_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1436,7 +1386,7 @@ func (x *APIActionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use APIActionRequest.ProtoReflect.Descriptor instead. func (*APIActionRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{19} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{18} } func (x *APIActionRequest) GetInstanceId() string { @@ -1491,7 +1441,7 @@ type NGINXPlusAction struct { func (x *NGINXPlusAction) Reset() { *x = NGINXPlusAction{} - mi := &file_mpi_v1_command_proto_msgTypes[20] + mi := &file_mpi_v1_command_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1503,7 +1453,7 @@ func (x *NGINXPlusAction) String() string { func (*NGINXPlusAction) ProtoMessage() {} func (x *NGINXPlusAction) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[20] + mi := &file_mpi_v1_command_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1516,7 +1466,7 @@ func (x *NGINXPlusAction) ProtoReflect() protoreflect.Message { // Deprecated: Use NGINXPlusAction.ProtoReflect.Descriptor instead. func (*NGINXPlusAction) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{20} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{19} } func (x *NGINXPlusAction) GetAction() isNGINXPlusAction_Action { @@ -1618,7 +1568,7 @@ type UpdateHTTPUpstreamServers struct { func (x *UpdateHTTPUpstreamServers) Reset() { *x = UpdateHTTPUpstreamServers{} - mi := &file_mpi_v1_command_proto_msgTypes[21] + mi := &file_mpi_v1_command_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1630,7 +1580,7 @@ func (x *UpdateHTTPUpstreamServers) String() string { func (*UpdateHTTPUpstreamServers) ProtoMessage() {} func (x *UpdateHTTPUpstreamServers) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[21] + mi := &file_mpi_v1_command_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1643,7 +1593,7 @@ func (x *UpdateHTTPUpstreamServers) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateHTTPUpstreamServers.ProtoReflect.Descriptor instead. func (*UpdateHTTPUpstreamServers) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{21} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{20} } func (x *UpdateHTTPUpstreamServers) GetHttpUpstreamName() string { @@ -1671,7 +1621,7 @@ type GetHTTPUpstreamServers struct { func (x *GetHTTPUpstreamServers) Reset() { *x = GetHTTPUpstreamServers{} - mi := &file_mpi_v1_command_proto_msgTypes[22] + mi := &file_mpi_v1_command_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1683,7 +1633,7 @@ func (x *GetHTTPUpstreamServers) String() string { func (*GetHTTPUpstreamServers) ProtoMessage() {} func (x *GetHTTPUpstreamServers) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[22] + mi := &file_mpi_v1_command_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1696,7 +1646,7 @@ func (x *GetHTTPUpstreamServers) ProtoReflect() protoreflect.Message { // Deprecated: Use GetHTTPUpstreamServers.ProtoReflect.Descriptor instead. func (*GetHTTPUpstreamServers) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{22} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{21} } func (x *GetHTTPUpstreamServers) GetHttpUpstreamName() string { @@ -1719,7 +1669,7 @@ type UpdateStreamServers struct { func (x *UpdateStreamServers) Reset() { *x = UpdateStreamServers{} - mi := &file_mpi_v1_command_proto_msgTypes[23] + mi := &file_mpi_v1_command_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1731,7 +1681,7 @@ func (x *UpdateStreamServers) String() string { func (*UpdateStreamServers) ProtoMessage() {} func (x *UpdateStreamServers) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[23] + mi := &file_mpi_v1_command_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1744,7 +1694,7 @@ func (x *UpdateStreamServers) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateStreamServers.ProtoReflect.Descriptor instead. func (*UpdateStreamServers) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{23} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{22} } func (x *UpdateStreamServers) GetUpstreamStreamName() string { @@ -1770,7 +1720,7 @@ type GetUpstreams struct { func (x *GetUpstreams) Reset() { *x = GetUpstreams{} - mi := &file_mpi_v1_command_proto_msgTypes[24] + mi := &file_mpi_v1_command_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1782,7 +1732,7 @@ func (x *GetUpstreams) String() string { func (*GetUpstreams) ProtoMessage() {} func (x *GetUpstreams) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[24] + mi := &file_mpi_v1_command_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1795,7 +1745,7 @@ func (x *GetUpstreams) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUpstreams.ProtoReflect.Descriptor instead. func (*GetUpstreams) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{24} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{23} } // Get Stream Upstream Servers for an instance @@ -1807,7 +1757,7 @@ type GetStreamUpstreams struct { func (x *GetStreamUpstreams) Reset() { *x = GetStreamUpstreams{} - mi := &file_mpi_v1_command_proto_msgTypes[25] + mi := &file_mpi_v1_command_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1819,7 +1769,7 @@ func (x *GetStreamUpstreams) String() string { func (*GetStreamUpstreams) ProtoMessage() {} func (x *GetStreamUpstreams) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[25] + mi := &file_mpi_v1_command_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1832,7 +1782,7 @@ func (x *GetStreamUpstreams) ProtoReflect() protoreflect.Message { // Deprecated: Use GetStreamUpstreams.ProtoReflect.Descriptor instead. func (*GetStreamUpstreams) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{25} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{24} } // Request an update on a particular command @@ -1844,7 +1794,7 @@ type CommandStatusRequest struct { func (x *CommandStatusRequest) Reset() { *x = CommandStatusRequest{} - mi := &file_mpi_v1_command_proto_msgTypes[26] + mi := &file_mpi_v1_command_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1856,7 +1806,7 @@ func (x *CommandStatusRequest) String() string { func (*CommandStatusRequest) ProtoMessage() {} func (x *CommandStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[26] + mi := &file_mpi_v1_command_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1869,7 +1819,7 @@ func (x *CommandStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CommandStatusRequest.ProtoReflect.Descriptor instead. func (*CommandStatusRequest) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{26} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{25} } // This represents an instance being reported on @@ -1887,7 +1837,7 @@ type Instance struct { func (x *Instance) Reset() { *x = Instance{} - mi := &file_mpi_v1_command_proto_msgTypes[27] + mi := &file_mpi_v1_command_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1899,7 +1849,7 @@ func (x *Instance) String() string { func (*Instance) ProtoMessage() {} func (x *Instance) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[27] + mi := &file_mpi_v1_command_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1912,7 +1862,7 @@ func (x *Instance) ProtoReflect() protoreflect.Message { // Deprecated: Use Instance.ProtoReflect.Descriptor instead. func (*Instance) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{27} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{26} } func (x *Instance) GetInstanceMeta() *InstanceMeta { @@ -1951,7 +1901,7 @@ type InstanceMeta struct { func (x *InstanceMeta) Reset() { *x = InstanceMeta{} - mi := &file_mpi_v1_command_proto_msgTypes[28] + mi := &file_mpi_v1_command_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1963,7 +1913,7 @@ func (x *InstanceMeta) String() string { func (*InstanceMeta) ProtoMessage() {} func (x *InstanceMeta) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[28] + mi := &file_mpi_v1_command_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1976,7 +1926,7 @@ func (x *InstanceMeta) ProtoReflect() protoreflect.Message { // Deprecated: Use InstanceMeta.ProtoReflect.Descriptor instead. func (*InstanceMeta) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{28} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{27} } func (x *InstanceMeta) GetInstanceId() string { @@ -2015,7 +1965,7 @@ type InstanceConfig struct { func (x *InstanceConfig) Reset() { *x = InstanceConfig{} - mi := &file_mpi_v1_command_proto_msgTypes[29] + mi := &file_mpi_v1_command_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2027,7 +1977,7 @@ func (x *InstanceConfig) String() string { func (*InstanceConfig) ProtoMessage() {} func (x *InstanceConfig) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[29] + mi := &file_mpi_v1_command_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2040,7 +1990,7 @@ func (x *InstanceConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use InstanceConfig.ProtoReflect.Descriptor instead. func (*InstanceConfig) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{29} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{28} } func (x *InstanceConfig) GetActions() []*InstanceAction { @@ -2101,7 +2051,7 @@ type InstanceRuntime struct { func (x *InstanceRuntime) Reset() { *x = InstanceRuntime{} - mi := &file_mpi_v1_command_proto_msgTypes[30] + mi := &file_mpi_v1_command_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2113,7 +2063,7 @@ func (x *InstanceRuntime) String() string { func (*InstanceRuntime) ProtoMessage() {} func (x *InstanceRuntime) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[30] + mi := &file_mpi_v1_command_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2126,7 +2076,7 @@ func (x *InstanceRuntime) ProtoReflect() protoreflect.Message { // Deprecated: Use InstanceRuntime.ProtoReflect.Descriptor instead. func (*InstanceRuntime) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{30} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{29} } func (x *InstanceRuntime) GetProcessId() int32 { @@ -2226,7 +2176,7 @@ type InstanceChild struct { func (x *InstanceChild) Reset() { *x = InstanceChild{} - mi := &file_mpi_v1_command_proto_msgTypes[31] + mi := &file_mpi_v1_command_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2238,7 +2188,7 @@ func (x *InstanceChild) String() string { func (*InstanceChild) ProtoMessage() {} func (x *InstanceChild) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[31] + mi := &file_mpi_v1_command_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2251,7 +2201,7 @@ func (x *InstanceChild) ProtoReflect() protoreflect.Message { // Deprecated: Use InstanceChild.ProtoReflect.Descriptor instead. func (*InstanceChild) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{31} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{30} } func (x *InstanceChild) GetProcessId() int32 { @@ -2280,7 +2230,7 @@ type NGINXRuntimeInfo struct { func (x *NGINXRuntimeInfo) Reset() { *x = NGINXRuntimeInfo{} - mi := &file_mpi_v1_command_proto_msgTypes[32] + mi := &file_mpi_v1_command_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2292,7 +2242,7 @@ func (x *NGINXRuntimeInfo) String() string { func (*NGINXRuntimeInfo) ProtoMessage() {} func (x *NGINXRuntimeInfo) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[32] + mi := &file_mpi_v1_command_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2305,7 +2255,7 @@ func (x *NGINXRuntimeInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use NGINXRuntimeInfo.ProtoReflect.Descriptor instead. func (*NGINXRuntimeInfo) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{32} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{31} } func (x *NGINXRuntimeInfo) GetStubStatus() *APIDetails { @@ -2364,7 +2314,7 @@ type NGINXPlusRuntimeInfo struct { func (x *NGINXPlusRuntimeInfo) Reset() { *x = NGINXPlusRuntimeInfo{} - mi := &file_mpi_v1_command_proto_msgTypes[33] + mi := &file_mpi_v1_command_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2376,7 +2326,7 @@ func (x *NGINXPlusRuntimeInfo) String() string { func (*NGINXPlusRuntimeInfo) ProtoMessage() {} func (x *NGINXPlusRuntimeInfo) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[33] + mi := &file_mpi_v1_command_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2389,7 +2339,7 @@ func (x *NGINXPlusRuntimeInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use NGINXPlusRuntimeInfo.ProtoReflect.Descriptor instead. func (*NGINXPlusRuntimeInfo) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{33} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{32} } func (x *NGINXPlusRuntimeInfo) GetStubStatus() *APIDetails { @@ -2448,7 +2398,7 @@ type APIDetails struct { func (x *APIDetails) Reset() { *x = APIDetails{} - mi := &file_mpi_v1_command_proto_msgTypes[34] + mi := &file_mpi_v1_command_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2460,7 +2410,7 @@ func (x *APIDetails) String() string { func (*APIDetails) ProtoMessage() {} func (x *APIDetails) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[34] + mi := &file_mpi_v1_command_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2473,7 +2423,7 @@ func (x *APIDetails) ProtoReflect() protoreflect.Message { // Deprecated: Use APIDetails.ProtoReflect.Descriptor instead. func (*APIDetails) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{34} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{33} } func (x *APIDetails) GetLocation() string { @@ -2514,7 +2464,7 @@ type NGINXAppProtectRuntimeInfo struct { func (x *NGINXAppProtectRuntimeInfo) Reset() { *x = NGINXAppProtectRuntimeInfo{} - mi := &file_mpi_v1_command_proto_msgTypes[35] + mi := &file_mpi_v1_command_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2526,7 +2476,7 @@ func (x *NGINXAppProtectRuntimeInfo) String() string { func (*NGINXAppProtectRuntimeInfo) ProtoMessage() {} func (x *NGINXAppProtectRuntimeInfo) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[35] + mi := &file_mpi_v1_command_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2539,7 +2489,7 @@ func (x *NGINXAppProtectRuntimeInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use NGINXAppProtectRuntimeInfo.ProtoReflect.Descriptor instead. func (*NGINXAppProtectRuntimeInfo) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{35} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{34} } func (x *NGINXAppProtectRuntimeInfo) GetRelease() string { @@ -2579,7 +2529,7 @@ type InstanceAction struct { func (x *InstanceAction) Reset() { *x = InstanceAction{} - mi := &file_mpi_v1_command_proto_msgTypes[36] + mi := &file_mpi_v1_command_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2591,7 +2541,7 @@ func (x *InstanceAction) String() string { func (*InstanceAction) ProtoMessage() {} func (x *InstanceAction) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[36] + mi := &file_mpi_v1_command_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2604,7 +2554,7 @@ func (x *InstanceAction) ProtoReflect() protoreflect.Message { // Deprecated: Use InstanceAction.ProtoReflect.Descriptor instead. func (*InstanceAction) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{36} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{35} } // This contains a series of NGINX Agent configurations @@ -2632,7 +2582,7 @@ type AgentConfig struct { func (x *AgentConfig) Reset() { *x = AgentConfig{} - mi := &file_mpi_v1_command_proto_msgTypes[37] + mi := &file_mpi_v1_command_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2644,7 +2594,7 @@ func (x *AgentConfig) String() string { func (*AgentConfig) ProtoMessage() {} func (x *AgentConfig) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[37] + mi := &file_mpi_v1_command_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2657,7 +2607,7 @@ func (x *AgentConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use AgentConfig.ProtoReflect.Descriptor instead. func (*AgentConfig) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{37} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{36} } func (x *AgentConfig) GetCommand() *CommandServer { @@ -2727,7 +2677,7 @@ type Log struct { func (x *Log) Reset() { *x = Log{} - mi := &file_mpi_v1_command_proto_msgTypes[38] + mi := &file_mpi_v1_command_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2739,7 +2689,7 @@ func (x *Log) String() string { func (*Log) ProtoMessage() {} func (x *Log) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[38] + mi := &file_mpi_v1_command_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2752,14 +2702,14 @@ func (x *Log) ProtoReflect() protoreflect.Message { // Deprecated: Use Log.ProtoReflect.Descriptor instead. func (*Log) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{38} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{37} } func (x *Log) GetLogLevel() Log_LogLevel { if x != nil { return x.LogLevel } - return Log_LOG_LEVEL_UNSPECIFIED + return Log_LOG_LEVEL_INFO } func (x *Log) GetLogPath() string { @@ -2784,7 +2734,7 @@ type CommandServer struct { func (x *CommandServer) Reset() { *x = CommandServer{} - mi := &file_mpi_v1_command_proto_msgTypes[39] + mi := &file_mpi_v1_command_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2796,7 +2746,7 @@ func (x *CommandServer) String() string { func (*CommandServer) ProtoMessage() {} func (x *CommandServer) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[39] + mi := &file_mpi_v1_command_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2809,7 +2759,7 @@ func (x *CommandServer) ProtoReflect() protoreflect.Message { // Deprecated: Use CommandServer.ProtoReflect.Descriptor instead. func (*CommandServer) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{39} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{38} } func (x *CommandServer) GetServer() *ServerSettings { @@ -2848,7 +2798,7 @@ type AuxiliaryCommandServer struct { func (x *AuxiliaryCommandServer) Reset() { *x = AuxiliaryCommandServer{} - mi := &file_mpi_v1_command_proto_msgTypes[40] + mi := &file_mpi_v1_command_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2860,7 +2810,7 @@ func (x *AuxiliaryCommandServer) String() string { func (*AuxiliaryCommandServer) ProtoMessage() {} func (x *AuxiliaryCommandServer) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[40] + mi := &file_mpi_v1_command_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2873,7 +2823,7 @@ func (x *AuxiliaryCommandServer) ProtoReflect() protoreflect.Message { // Deprecated: Use AuxiliaryCommandServer.ProtoReflect.Descriptor instead. func (*AuxiliaryCommandServer) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{40} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{39} } func (x *AuxiliaryCommandServer) GetServer() *ServerSettings { @@ -2906,7 +2856,7 @@ type MetricsServer struct { func (x *MetricsServer) Reset() { *x = MetricsServer{} - mi := &file_mpi_v1_command_proto_msgTypes[41] + mi := &file_mpi_v1_command_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2918,7 +2868,7 @@ func (x *MetricsServer) String() string { func (*MetricsServer) ProtoMessage() {} func (x *MetricsServer) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[41] + mi := &file_mpi_v1_command_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2931,7 +2881,7 @@ func (x *MetricsServer) ProtoReflect() protoreflect.Message { // Deprecated: Use MetricsServer.ProtoReflect.Descriptor instead. func (*MetricsServer) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{41} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{40} } // The file settings associated with file server for configurations @@ -2943,7 +2893,7 @@ type FileServer struct { func (x *FileServer) Reset() { *x = FileServer{} - mi := &file_mpi_v1_command_proto_msgTypes[42] + mi := &file_mpi_v1_command_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2955,7 +2905,7 @@ func (x *FileServer) String() string { func (*FileServer) ProtoMessage() {} func (x *FileServer) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[42] + mi := &file_mpi_v1_command_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2968,7 +2918,7 @@ func (x *FileServer) ProtoReflect() protoreflect.Message { // Deprecated: Use FileServer.ProtoReflect.Descriptor instead. func (*FileServer) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{42} + return file_mpi_v1_command_proto_rawDescGZIP(), []int{41} } var File_mpi_v1_command_proto protoreflect.FileDescriptor @@ -3007,12 +2957,10 @@ const file_mpi_v1_command_proto_rawDesc = "" + "\x1cUpdateDataPlaneStatusRequest\x126\n" + "\fmessage_meta\x18\x01 \x01(\v2\x13.mpi.v1.MessageMetaR\vmessageMeta\x12,\n" + "\bresource\x18\x02 \x01(\v2\x10.mpi.v1.ResourceR\bresource\"\x1f\n" + - "\x1dUpdateDataPlaneStatusResponse\"\x96\x01\n" + - "$UpdateNginxAgentConfigurationRequest\x126\n" + + "\x1dUpdateDataPlaneStatusResponse\"\x8a\x01\n" + + "\x18UpdateAgentConfigRequest\x126\n" + "\fmessage_meta\x18\x01 \x01(\v2\x13.mpi.v1.MessageMetaR\vmessageMeta\x126\n" + - "\fagent_config\x18\x02 \x01(\v2\x13.mpi.v1.AgentConfigR\vagentConfig\"\\\n" + - "%UpdateNginxAgentConfigurationResponse\x123\n" + - "\bresponse\x18\x01 \x01(\v2\x17.mpi.v1.CommandResponseR\bresponse\"\xf0\x02\n" + + "\fagent_config\x18\x02 \x01(\v2\x13.mpi.v1.AgentConfigR\vagentConfig\"\xf0\x02\n" + "\x0eInstanceHealth\x12)\n" + "\vinstance_id\x18\x01 \x01(\tB\b\xbaH\x05r\x03\xb0\x01\x01R\n" + "instanceId\x12a\n" + @@ -3031,7 +2979,7 @@ const file_mpi_v1_command_proto_rawDesc = "" + "\fmessage_meta\x18\x01 \x01(\v2\x13.mpi.v1.MessageMetaR\vmessageMeta\x12B\n" + "\x10command_response\x18\x02 \x01(\v2\x17.mpi.v1.CommandResponseR\x0fcommandResponse\x12\x1f\n" + "\vinstance_id\x18\x03 \x01(\tR\n" + - "instanceId\"\xa0\x05\n" + + "instanceId\"\xfa\x04\n" + "\x16ManagementPlaneRequest\x126\n" + "\fmessage_meta\x18\x01 \x01(\v2\x13.mpi.v1.MessageMetaR\vmessageMeta\x12>\n" + "\x0estatus_request\x18\x02 \x01(\v2\x15.mpi.v1.StatusRequestH\x00R\rstatusRequest\x12>\n" + @@ -3039,8 +2987,8 @@ const file_mpi_v1_command_proto_rawDesc = "" + "\x14config_apply_request\x18\x05 \x01(\v2\x1a.mpi.v1.ConfigApplyRequestH\x00R\x12configApplyRequest\x12Q\n" + "\x15config_upload_request\x18\x06 \x01(\v2\x1b.mpi.v1.ConfigUploadRequestH\x00R\x13configUploadRequest\x12A\n" + "\x0eaction_request\x18\a \x01(\v2\x18.mpi.v1.APIActionRequestH\x00R\ractionRequest\x12T\n" + - "\x16command_status_request\x18\b \x01(\v2\x1c.mpi.v1.CommandStatusRequestH\x00R\x14commandStatusRequest\x12\x86\x01\n" + - "(update_nginx_agent_configuration_request\x18\t \x01(\v2,.mpi.v1.UpdateNginxAgentConfigurationRequestH\x00R$updateNginxAgentConfigurationRequestB\t\n" + + "\x16command_status_request\x18\b \x01(\v2\x1c.mpi.v1.CommandStatusRequestH\x00R\x14commandStatusRequest\x12a\n" + + "\x1bupdate_agent_config_request\x18\t \x01(\v2 .mpi.v1.UpdateAgentConfigRequestH\x00R\x18updateAgentConfigRequestB\t\n" + "\arequest\"\x0f\n" + "\rStatusRequest\"\x0f\n" + "\rHealthRequest\"F\n" + @@ -3146,16 +3094,15 @@ const file_mpi_v1_command_proto_rawDesc = "" + "\bfeatures\x18\x05 \x03(\tR\bfeatures\x12.\n" + "\x13message_buffer_size\x18\x06 \x01(\tR\x11messageBufferSize\x12K\n" + "\x11auxiliary_command\x18\a \x01(\v2\x1e.mpi.v1.AuxiliaryCommandServerR\x10auxiliaryCommand\x12\x1d\n" + - "\x03log\x18\b \x01(\v2\v.mpi.v1.LogR\x03log\"\xcc\x01\n" + + "\x03log\x18\b \x01(\v2\v.mpi.v1.LogR\x03log\"\xb1\x01\n" + "\x03Log\x121\n" + "\tlog_level\x18\x01 \x01(\x0e2\x14.mpi.v1.Log.LogLevelR\blogLevel\x12\x19\n" + - "\blog_path\x18\x02 \x01(\tR\alogPath\"w\n" + - "\bLogLevel\x12\x19\n" + - "\x15LOG_LEVEL_UNSPECIFIED\x10\x00\x12\x13\n" + + "\blog_path\x18\x02 \x01(\tR\alogPath\"\\\n" + + "\bLogLevel\x12\x12\n" + + "\x0eLOG_LEVEL_INFO\x10\x00\x12\x13\n" + "\x0fLOG_LEVEL_ERROR\x10\x01\x12\x12\n" + - "\x0eLOG_LEVEL_WARN\x10\x02\x12\x12\n" + - "\x0eLOG_LEVEL_INFO\x10\x03\x12\x13\n" + - "\x0fLOG_LEVEL_DEBUG\x10\x04\"\x90\x01\n" + + "\x0eLOG_LEVEL_WARN\x10\x02\x12\x13\n" + + "\x0fLOG_LEVEL_DEBUG\x10\x03\"\x90\x01\n" + "\rCommandServer\x12.\n" + "\x06server\x18\x01 \x01(\v2\x16.mpi.v1.ServerSettingsR\x06server\x12(\n" + "\x04auth\x18\x02 \x01(\v2\x14.mpi.v1.AuthSettingsR\x04auth\x12%\n" + @@ -3186,139 +3133,137 @@ func file_mpi_v1_command_proto_rawDescGZIP() []byte { } var file_mpi_v1_command_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_mpi_v1_command_proto_msgTypes = make([]protoimpl.MessageInfo, 43) +var file_mpi_v1_command_proto_msgTypes = make([]protoimpl.MessageInfo, 42) var file_mpi_v1_command_proto_goTypes = []any{ - (InstanceHealth_InstanceHealthStatus)(0), // 0: mpi.v1.InstanceHealth.InstanceHealthStatus - (InstanceMeta_InstanceType)(0), // 1: mpi.v1.InstanceMeta.InstanceType - (Log_LogLevel)(0), // 2: mpi.v1.Log.LogLevel - (*CreateConnectionRequest)(nil), // 3: mpi.v1.CreateConnectionRequest - (*Resource)(nil), // 4: mpi.v1.Resource - (*HostInfo)(nil), // 5: mpi.v1.HostInfo - (*ReleaseInfo)(nil), // 6: mpi.v1.ReleaseInfo - (*ContainerInfo)(nil), // 7: mpi.v1.ContainerInfo - (*CreateConnectionResponse)(nil), // 8: mpi.v1.CreateConnectionResponse - (*UpdateDataPlaneStatusRequest)(nil), // 9: mpi.v1.UpdateDataPlaneStatusRequest - (*UpdateDataPlaneStatusResponse)(nil), // 10: mpi.v1.UpdateDataPlaneStatusResponse - (*UpdateNginxAgentConfigurationRequest)(nil), // 11: mpi.v1.UpdateNginxAgentConfigurationRequest - (*UpdateNginxAgentConfigurationResponse)(nil), // 12: mpi.v1.UpdateNginxAgentConfigurationResponse - (*InstanceHealth)(nil), // 13: mpi.v1.InstanceHealth - (*UpdateDataPlaneHealthRequest)(nil), // 14: mpi.v1.UpdateDataPlaneHealthRequest - (*UpdateDataPlaneHealthResponse)(nil), // 15: mpi.v1.UpdateDataPlaneHealthResponse - (*DataPlaneResponse)(nil), // 16: mpi.v1.DataPlaneResponse - (*ManagementPlaneRequest)(nil), // 17: mpi.v1.ManagementPlaneRequest - (*StatusRequest)(nil), // 18: mpi.v1.StatusRequest - (*HealthRequest)(nil), // 19: mpi.v1.HealthRequest - (*ConfigApplyRequest)(nil), // 20: mpi.v1.ConfigApplyRequest - (*ConfigUploadRequest)(nil), // 21: mpi.v1.ConfigUploadRequest - (*APIActionRequest)(nil), // 22: mpi.v1.APIActionRequest - (*NGINXPlusAction)(nil), // 23: mpi.v1.NGINXPlusAction - (*UpdateHTTPUpstreamServers)(nil), // 24: mpi.v1.UpdateHTTPUpstreamServers - (*GetHTTPUpstreamServers)(nil), // 25: mpi.v1.GetHTTPUpstreamServers - (*UpdateStreamServers)(nil), // 26: mpi.v1.UpdateStreamServers - (*GetUpstreams)(nil), // 27: mpi.v1.GetUpstreams - (*GetStreamUpstreams)(nil), // 28: mpi.v1.GetStreamUpstreams - (*CommandStatusRequest)(nil), // 29: mpi.v1.CommandStatusRequest - (*Instance)(nil), // 30: mpi.v1.Instance - (*InstanceMeta)(nil), // 31: mpi.v1.InstanceMeta - (*InstanceConfig)(nil), // 32: mpi.v1.InstanceConfig - (*InstanceRuntime)(nil), // 33: mpi.v1.InstanceRuntime - (*InstanceChild)(nil), // 34: mpi.v1.InstanceChild - (*NGINXRuntimeInfo)(nil), // 35: mpi.v1.NGINXRuntimeInfo - (*NGINXPlusRuntimeInfo)(nil), // 36: mpi.v1.NGINXPlusRuntimeInfo - (*APIDetails)(nil), // 37: mpi.v1.APIDetails - (*NGINXAppProtectRuntimeInfo)(nil), // 38: mpi.v1.NGINXAppProtectRuntimeInfo - (*InstanceAction)(nil), // 39: mpi.v1.InstanceAction - (*AgentConfig)(nil), // 40: mpi.v1.AgentConfig - (*Log)(nil), // 41: mpi.v1.Log - (*CommandServer)(nil), // 42: mpi.v1.CommandServer - (*AuxiliaryCommandServer)(nil), // 43: mpi.v1.AuxiliaryCommandServer - (*MetricsServer)(nil), // 44: mpi.v1.MetricsServer - (*FileServer)(nil), // 45: mpi.v1.FileServer - (*MessageMeta)(nil), // 46: mpi.v1.MessageMeta - (*CommandResponse)(nil), // 47: mpi.v1.CommandResponse - (*FileOverview)(nil), // 48: mpi.v1.FileOverview - (*structpb.Struct)(nil), // 49: google.protobuf.Struct - (*ServerSettings)(nil), // 50: mpi.v1.ServerSettings - (*AuthSettings)(nil), // 51: mpi.v1.AuthSettings - (*TLSSettings)(nil), // 52: mpi.v1.TLSSettings + (InstanceHealth_InstanceHealthStatus)(0), // 0: mpi.v1.InstanceHealth.InstanceHealthStatus + (InstanceMeta_InstanceType)(0), // 1: mpi.v1.InstanceMeta.InstanceType + (Log_LogLevel)(0), // 2: mpi.v1.Log.LogLevel + (*CreateConnectionRequest)(nil), // 3: mpi.v1.CreateConnectionRequest + (*Resource)(nil), // 4: mpi.v1.Resource + (*HostInfo)(nil), // 5: mpi.v1.HostInfo + (*ReleaseInfo)(nil), // 6: mpi.v1.ReleaseInfo + (*ContainerInfo)(nil), // 7: mpi.v1.ContainerInfo + (*CreateConnectionResponse)(nil), // 8: mpi.v1.CreateConnectionResponse + (*UpdateDataPlaneStatusRequest)(nil), // 9: mpi.v1.UpdateDataPlaneStatusRequest + (*UpdateDataPlaneStatusResponse)(nil), // 10: mpi.v1.UpdateDataPlaneStatusResponse + (*UpdateAgentConfigRequest)(nil), // 11: mpi.v1.UpdateAgentConfigRequest + (*InstanceHealth)(nil), // 12: mpi.v1.InstanceHealth + (*UpdateDataPlaneHealthRequest)(nil), // 13: mpi.v1.UpdateDataPlaneHealthRequest + (*UpdateDataPlaneHealthResponse)(nil), // 14: mpi.v1.UpdateDataPlaneHealthResponse + (*DataPlaneResponse)(nil), // 15: mpi.v1.DataPlaneResponse + (*ManagementPlaneRequest)(nil), // 16: mpi.v1.ManagementPlaneRequest + (*StatusRequest)(nil), // 17: mpi.v1.StatusRequest + (*HealthRequest)(nil), // 18: mpi.v1.HealthRequest + (*ConfigApplyRequest)(nil), // 19: mpi.v1.ConfigApplyRequest + (*ConfigUploadRequest)(nil), // 20: mpi.v1.ConfigUploadRequest + (*APIActionRequest)(nil), // 21: mpi.v1.APIActionRequest + (*NGINXPlusAction)(nil), // 22: mpi.v1.NGINXPlusAction + (*UpdateHTTPUpstreamServers)(nil), // 23: mpi.v1.UpdateHTTPUpstreamServers + (*GetHTTPUpstreamServers)(nil), // 24: mpi.v1.GetHTTPUpstreamServers + (*UpdateStreamServers)(nil), // 25: mpi.v1.UpdateStreamServers + (*GetUpstreams)(nil), // 26: mpi.v1.GetUpstreams + (*GetStreamUpstreams)(nil), // 27: mpi.v1.GetStreamUpstreams + (*CommandStatusRequest)(nil), // 28: mpi.v1.CommandStatusRequest + (*Instance)(nil), // 29: mpi.v1.Instance + (*InstanceMeta)(nil), // 30: mpi.v1.InstanceMeta + (*InstanceConfig)(nil), // 31: mpi.v1.InstanceConfig + (*InstanceRuntime)(nil), // 32: mpi.v1.InstanceRuntime + (*InstanceChild)(nil), // 33: mpi.v1.InstanceChild + (*NGINXRuntimeInfo)(nil), // 34: mpi.v1.NGINXRuntimeInfo + (*NGINXPlusRuntimeInfo)(nil), // 35: mpi.v1.NGINXPlusRuntimeInfo + (*APIDetails)(nil), // 36: mpi.v1.APIDetails + (*NGINXAppProtectRuntimeInfo)(nil), // 37: mpi.v1.NGINXAppProtectRuntimeInfo + (*InstanceAction)(nil), // 38: mpi.v1.InstanceAction + (*AgentConfig)(nil), // 39: mpi.v1.AgentConfig + (*Log)(nil), // 40: mpi.v1.Log + (*CommandServer)(nil), // 41: mpi.v1.CommandServer + (*AuxiliaryCommandServer)(nil), // 42: mpi.v1.AuxiliaryCommandServer + (*MetricsServer)(nil), // 43: mpi.v1.MetricsServer + (*FileServer)(nil), // 44: mpi.v1.FileServer + (*MessageMeta)(nil), // 45: mpi.v1.MessageMeta + (*CommandResponse)(nil), // 46: mpi.v1.CommandResponse + (*FileOverview)(nil), // 47: mpi.v1.FileOverview + (*structpb.Struct)(nil), // 48: google.protobuf.Struct + (*ServerSettings)(nil), // 49: mpi.v1.ServerSettings + (*AuthSettings)(nil), // 50: mpi.v1.AuthSettings + (*TLSSettings)(nil), // 51: mpi.v1.TLSSettings } var file_mpi_v1_command_proto_depIdxs = []int32{ - 46, // 0: mpi.v1.CreateConnectionRequest.message_meta:type_name -> mpi.v1.MessageMeta + 45, // 0: mpi.v1.CreateConnectionRequest.message_meta:type_name -> mpi.v1.MessageMeta 4, // 1: mpi.v1.CreateConnectionRequest.resource:type_name -> mpi.v1.Resource - 30, // 2: mpi.v1.Resource.instances:type_name -> mpi.v1.Instance + 29, // 2: mpi.v1.Resource.instances:type_name -> mpi.v1.Instance 5, // 3: mpi.v1.Resource.host_info:type_name -> mpi.v1.HostInfo 7, // 4: mpi.v1.Resource.container_info:type_name -> mpi.v1.ContainerInfo 6, // 5: mpi.v1.HostInfo.release_info:type_name -> mpi.v1.ReleaseInfo 6, // 6: mpi.v1.ContainerInfo.release_info:type_name -> mpi.v1.ReleaseInfo - 47, // 7: mpi.v1.CreateConnectionResponse.response:type_name -> mpi.v1.CommandResponse - 40, // 8: mpi.v1.CreateConnectionResponse.agent_config:type_name -> mpi.v1.AgentConfig - 46, // 9: mpi.v1.UpdateDataPlaneStatusRequest.message_meta:type_name -> mpi.v1.MessageMeta + 46, // 7: mpi.v1.CreateConnectionResponse.response:type_name -> mpi.v1.CommandResponse + 39, // 8: mpi.v1.CreateConnectionResponse.agent_config:type_name -> mpi.v1.AgentConfig + 45, // 9: mpi.v1.UpdateDataPlaneStatusRequest.message_meta:type_name -> mpi.v1.MessageMeta 4, // 10: mpi.v1.UpdateDataPlaneStatusRequest.resource:type_name -> mpi.v1.Resource - 46, // 11: mpi.v1.UpdateNginxAgentConfigurationRequest.message_meta:type_name -> mpi.v1.MessageMeta - 40, // 12: mpi.v1.UpdateNginxAgentConfigurationRequest.agent_config:type_name -> mpi.v1.AgentConfig - 47, // 13: mpi.v1.UpdateNginxAgentConfigurationResponse.response:type_name -> mpi.v1.CommandResponse - 0, // 14: mpi.v1.InstanceHealth.instance_health_status:type_name -> mpi.v1.InstanceHealth.InstanceHealthStatus - 46, // 15: mpi.v1.UpdateDataPlaneHealthRequest.message_meta:type_name -> mpi.v1.MessageMeta - 13, // 16: mpi.v1.UpdateDataPlaneHealthRequest.instance_healths:type_name -> mpi.v1.InstanceHealth - 46, // 17: mpi.v1.DataPlaneResponse.message_meta:type_name -> mpi.v1.MessageMeta - 47, // 18: mpi.v1.DataPlaneResponse.command_response:type_name -> mpi.v1.CommandResponse - 46, // 19: mpi.v1.ManagementPlaneRequest.message_meta:type_name -> mpi.v1.MessageMeta - 18, // 20: mpi.v1.ManagementPlaneRequest.status_request:type_name -> mpi.v1.StatusRequest - 19, // 21: mpi.v1.ManagementPlaneRequest.health_request:type_name -> mpi.v1.HealthRequest - 20, // 22: mpi.v1.ManagementPlaneRequest.config_apply_request:type_name -> mpi.v1.ConfigApplyRequest - 21, // 23: mpi.v1.ManagementPlaneRequest.config_upload_request:type_name -> mpi.v1.ConfigUploadRequest - 22, // 24: mpi.v1.ManagementPlaneRequest.action_request:type_name -> mpi.v1.APIActionRequest - 29, // 25: mpi.v1.ManagementPlaneRequest.command_status_request:type_name -> mpi.v1.CommandStatusRequest - 11, // 26: mpi.v1.ManagementPlaneRequest.update_nginx_agent_configuration_request:type_name -> mpi.v1.UpdateNginxAgentConfigurationRequest - 48, // 27: mpi.v1.ConfigApplyRequest.overview:type_name -> mpi.v1.FileOverview - 48, // 28: mpi.v1.ConfigUploadRequest.overview:type_name -> mpi.v1.FileOverview - 23, // 29: mpi.v1.APIActionRequest.nginx_plus_action:type_name -> mpi.v1.NGINXPlusAction - 24, // 30: mpi.v1.NGINXPlusAction.update_http_upstream_servers:type_name -> mpi.v1.UpdateHTTPUpstreamServers - 25, // 31: mpi.v1.NGINXPlusAction.get_http_upstream_servers:type_name -> mpi.v1.GetHTTPUpstreamServers - 26, // 32: mpi.v1.NGINXPlusAction.update_stream_servers:type_name -> mpi.v1.UpdateStreamServers - 27, // 33: mpi.v1.NGINXPlusAction.get_upstreams:type_name -> mpi.v1.GetUpstreams - 28, // 34: mpi.v1.NGINXPlusAction.get_stream_upstreams:type_name -> mpi.v1.GetStreamUpstreams - 49, // 35: mpi.v1.UpdateHTTPUpstreamServers.servers:type_name -> google.protobuf.Struct - 49, // 36: mpi.v1.UpdateStreamServers.servers:type_name -> google.protobuf.Struct - 31, // 37: mpi.v1.Instance.instance_meta:type_name -> mpi.v1.InstanceMeta - 32, // 38: mpi.v1.Instance.instance_config:type_name -> mpi.v1.InstanceConfig - 33, // 39: mpi.v1.Instance.instance_runtime:type_name -> mpi.v1.InstanceRuntime - 1, // 40: mpi.v1.InstanceMeta.instance_type:type_name -> mpi.v1.InstanceMeta.InstanceType - 39, // 41: mpi.v1.InstanceConfig.actions:type_name -> mpi.v1.InstanceAction - 40, // 42: mpi.v1.InstanceConfig.agent_config:type_name -> mpi.v1.AgentConfig - 35, // 43: mpi.v1.InstanceRuntime.nginx_runtime_info:type_name -> mpi.v1.NGINXRuntimeInfo - 36, // 44: mpi.v1.InstanceRuntime.nginx_plus_runtime_info:type_name -> mpi.v1.NGINXPlusRuntimeInfo - 38, // 45: mpi.v1.InstanceRuntime.nginx_app_protect_runtime_info:type_name -> mpi.v1.NGINXAppProtectRuntimeInfo - 34, // 46: mpi.v1.InstanceRuntime.instance_children:type_name -> mpi.v1.InstanceChild - 37, // 47: mpi.v1.NGINXRuntimeInfo.stub_status:type_name -> mpi.v1.APIDetails - 37, // 48: mpi.v1.NGINXPlusRuntimeInfo.stub_status:type_name -> mpi.v1.APIDetails - 37, // 49: mpi.v1.NGINXPlusRuntimeInfo.plus_api:type_name -> mpi.v1.APIDetails - 42, // 50: mpi.v1.AgentConfig.command:type_name -> mpi.v1.CommandServer - 44, // 51: mpi.v1.AgentConfig.metrics:type_name -> mpi.v1.MetricsServer - 45, // 52: mpi.v1.AgentConfig.file:type_name -> mpi.v1.FileServer - 49, // 53: mpi.v1.AgentConfig.labels:type_name -> google.protobuf.Struct - 43, // 54: mpi.v1.AgentConfig.auxiliary_command:type_name -> mpi.v1.AuxiliaryCommandServer - 41, // 55: mpi.v1.AgentConfig.log:type_name -> mpi.v1.Log - 2, // 56: mpi.v1.Log.log_level:type_name -> mpi.v1.Log.LogLevel - 50, // 57: mpi.v1.CommandServer.server:type_name -> mpi.v1.ServerSettings - 51, // 58: mpi.v1.CommandServer.auth:type_name -> mpi.v1.AuthSettings - 52, // 59: mpi.v1.CommandServer.tls:type_name -> mpi.v1.TLSSettings - 50, // 60: mpi.v1.AuxiliaryCommandServer.server:type_name -> mpi.v1.ServerSettings - 51, // 61: mpi.v1.AuxiliaryCommandServer.auth:type_name -> mpi.v1.AuthSettings - 52, // 62: mpi.v1.AuxiliaryCommandServer.tls:type_name -> mpi.v1.TLSSettings - 3, // 63: mpi.v1.CommandService.CreateConnection:input_type -> mpi.v1.CreateConnectionRequest - 9, // 64: mpi.v1.CommandService.UpdateDataPlaneStatus:input_type -> mpi.v1.UpdateDataPlaneStatusRequest - 14, // 65: mpi.v1.CommandService.UpdateDataPlaneHealth:input_type -> mpi.v1.UpdateDataPlaneHealthRequest - 16, // 66: mpi.v1.CommandService.Subscribe:input_type -> mpi.v1.DataPlaneResponse - 8, // 67: mpi.v1.CommandService.CreateConnection:output_type -> mpi.v1.CreateConnectionResponse - 10, // 68: mpi.v1.CommandService.UpdateDataPlaneStatus:output_type -> mpi.v1.UpdateDataPlaneStatusResponse - 15, // 69: mpi.v1.CommandService.UpdateDataPlaneHealth:output_type -> mpi.v1.UpdateDataPlaneHealthResponse - 17, // 70: mpi.v1.CommandService.Subscribe:output_type -> mpi.v1.ManagementPlaneRequest - 67, // [67:71] is the sub-list for method output_type - 63, // [63:67] is the sub-list for method input_type - 63, // [63:63] is the sub-list for extension type_name - 63, // [63:63] is the sub-list for extension extendee - 0, // [0:63] is the sub-list for field type_name + 45, // 11: mpi.v1.UpdateAgentConfigRequest.message_meta:type_name -> mpi.v1.MessageMeta + 39, // 12: mpi.v1.UpdateAgentConfigRequest.agent_config:type_name -> mpi.v1.AgentConfig + 0, // 13: mpi.v1.InstanceHealth.instance_health_status:type_name -> mpi.v1.InstanceHealth.InstanceHealthStatus + 45, // 14: mpi.v1.UpdateDataPlaneHealthRequest.message_meta:type_name -> mpi.v1.MessageMeta + 12, // 15: mpi.v1.UpdateDataPlaneHealthRequest.instance_healths:type_name -> mpi.v1.InstanceHealth + 45, // 16: mpi.v1.DataPlaneResponse.message_meta:type_name -> mpi.v1.MessageMeta + 46, // 17: mpi.v1.DataPlaneResponse.command_response:type_name -> mpi.v1.CommandResponse + 45, // 18: mpi.v1.ManagementPlaneRequest.message_meta:type_name -> mpi.v1.MessageMeta + 17, // 19: mpi.v1.ManagementPlaneRequest.status_request:type_name -> mpi.v1.StatusRequest + 18, // 20: mpi.v1.ManagementPlaneRequest.health_request:type_name -> mpi.v1.HealthRequest + 19, // 21: mpi.v1.ManagementPlaneRequest.config_apply_request:type_name -> mpi.v1.ConfigApplyRequest + 20, // 22: mpi.v1.ManagementPlaneRequest.config_upload_request:type_name -> mpi.v1.ConfigUploadRequest + 21, // 23: mpi.v1.ManagementPlaneRequest.action_request:type_name -> mpi.v1.APIActionRequest + 28, // 24: mpi.v1.ManagementPlaneRequest.command_status_request:type_name -> mpi.v1.CommandStatusRequest + 11, // 25: mpi.v1.ManagementPlaneRequest.update_agent_config_request:type_name -> mpi.v1.UpdateAgentConfigRequest + 47, // 26: mpi.v1.ConfigApplyRequest.overview:type_name -> mpi.v1.FileOverview + 47, // 27: mpi.v1.ConfigUploadRequest.overview:type_name -> mpi.v1.FileOverview + 22, // 28: mpi.v1.APIActionRequest.nginx_plus_action:type_name -> mpi.v1.NGINXPlusAction + 23, // 29: mpi.v1.NGINXPlusAction.update_http_upstream_servers:type_name -> mpi.v1.UpdateHTTPUpstreamServers + 24, // 30: mpi.v1.NGINXPlusAction.get_http_upstream_servers:type_name -> mpi.v1.GetHTTPUpstreamServers + 25, // 31: mpi.v1.NGINXPlusAction.update_stream_servers:type_name -> mpi.v1.UpdateStreamServers + 26, // 32: mpi.v1.NGINXPlusAction.get_upstreams:type_name -> mpi.v1.GetUpstreams + 27, // 33: mpi.v1.NGINXPlusAction.get_stream_upstreams:type_name -> mpi.v1.GetStreamUpstreams + 48, // 34: mpi.v1.UpdateHTTPUpstreamServers.servers:type_name -> google.protobuf.Struct + 48, // 35: mpi.v1.UpdateStreamServers.servers:type_name -> google.protobuf.Struct + 30, // 36: mpi.v1.Instance.instance_meta:type_name -> mpi.v1.InstanceMeta + 31, // 37: mpi.v1.Instance.instance_config:type_name -> mpi.v1.InstanceConfig + 32, // 38: mpi.v1.Instance.instance_runtime:type_name -> mpi.v1.InstanceRuntime + 1, // 39: mpi.v1.InstanceMeta.instance_type:type_name -> mpi.v1.InstanceMeta.InstanceType + 38, // 40: mpi.v1.InstanceConfig.actions:type_name -> mpi.v1.InstanceAction + 39, // 41: mpi.v1.InstanceConfig.agent_config:type_name -> mpi.v1.AgentConfig + 34, // 42: mpi.v1.InstanceRuntime.nginx_runtime_info:type_name -> mpi.v1.NGINXRuntimeInfo + 35, // 43: mpi.v1.InstanceRuntime.nginx_plus_runtime_info:type_name -> mpi.v1.NGINXPlusRuntimeInfo + 37, // 44: mpi.v1.InstanceRuntime.nginx_app_protect_runtime_info:type_name -> mpi.v1.NGINXAppProtectRuntimeInfo + 33, // 45: mpi.v1.InstanceRuntime.instance_children:type_name -> mpi.v1.InstanceChild + 36, // 46: mpi.v1.NGINXRuntimeInfo.stub_status:type_name -> mpi.v1.APIDetails + 36, // 47: mpi.v1.NGINXPlusRuntimeInfo.stub_status:type_name -> mpi.v1.APIDetails + 36, // 48: mpi.v1.NGINXPlusRuntimeInfo.plus_api:type_name -> mpi.v1.APIDetails + 41, // 49: mpi.v1.AgentConfig.command:type_name -> mpi.v1.CommandServer + 43, // 50: mpi.v1.AgentConfig.metrics:type_name -> mpi.v1.MetricsServer + 44, // 51: mpi.v1.AgentConfig.file:type_name -> mpi.v1.FileServer + 48, // 52: mpi.v1.AgentConfig.labels:type_name -> google.protobuf.Struct + 42, // 53: mpi.v1.AgentConfig.auxiliary_command:type_name -> mpi.v1.AuxiliaryCommandServer + 40, // 54: mpi.v1.AgentConfig.log:type_name -> mpi.v1.Log + 2, // 55: mpi.v1.Log.log_level:type_name -> mpi.v1.Log.LogLevel + 49, // 56: mpi.v1.CommandServer.server:type_name -> mpi.v1.ServerSettings + 50, // 57: mpi.v1.CommandServer.auth:type_name -> mpi.v1.AuthSettings + 51, // 58: mpi.v1.CommandServer.tls:type_name -> mpi.v1.TLSSettings + 49, // 59: mpi.v1.AuxiliaryCommandServer.server:type_name -> mpi.v1.ServerSettings + 50, // 60: mpi.v1.AuxiliaryCommandServer.auth:type_name -> mpi.v1.AuthSettings + 51, // 61: mpi.v1.AuxiliaryCommandServer.tls:type_name -> mpi.v1.TLSSettings + 3, // 62: mpi.v1.CommandService.CreateConnection:input_type -> mpi.v1.CreateConnectionRequest + 9, // 63: mpi.v1.CommandService.UpdateDataPlaneStatus:input_type -> mpi.v1.UpdateDataPlaneStatusRequest + 13, // 64: mpi.v1.CommandService.UpdateDataPlaneHealth:input_type -> mpi.v1.UpdateDataPlaneHealthRequest + 15, // 65: mpi.v1.CommandService.Subscribe:input_type -> mpi.v1.DataPlaneResponse + 8, // 66: mpi.v1.CommandService.CreateConnection:output_type -> mpi.v1.CreateConnectionResponse + 10, // 67: mpi.v1.CommandService.UpdateDataPlaneStatus:output_type -> mpi.v1.UpdateDataPlaneStatusResponse + 14, // 68: mpi.v1.CommandService.UpdateDataPlaneHealth:output_type -> mpi.v1.UpdateDataPlaneHealthResponse + 16, // 69: mpi.v1.CommandService.Subscribe:output_type -> mpi.v1.ManagementPlaneRequest + 66, // [66:70] is the sub-list for method output_type + 62, // [62:66] is the sub-list for method input_type + 62, // [62:62] is the sub-list for extension type_name + 62, // [62:62] is the sub-list for extension extendee + 0, // [0:62] is the sub-list for field type_name } func init() { file_mpi_v1_command_proto_init() } @@ -3332,29 +3277,29 @@ func file_mpi_v1_command_proto_init() { (*Resource_HostInfo)(nil), (*Resource_ContainerInfo)(nil), } - file_mpi_v1_command_proto_msgTypes[14].OneofWrappers = []any{ + file_mpi_v1_command_proto_msgTypes[13].OneofWrappers = []any{ (*ManagementPlaneRequest_StatusRequest)(nil), (*ManagementPlaneRequest_HealthRequest)(nil), (*ManagementPlaneRequest_ConfigApplyRequest)(nil), (*ManagementPlaneRequest_ConfigUploadRequest)(nil), (*ManagementPlaneRequest_ActionRequest)(nil), (*ManagementPlaneRequest_CommandStatusRequest)(nil), - (*ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest)(nil), + (*ManagementPlaneRequest_UpdateAgentConfigRequest)(nil), } - file_mpi_v1_command_proto_msgTypes[19].OneofWrappers = []any{ + file_mpi_v1_command_proto_msgTypes[18].OneofWrappers = []any{ (*APIActionRequest_NginxPlusAction)(nil), } - file_mpi_v1_command_proto_msgTypes[20].OneofWrappers = []any{ + file_mpi_v1_command_proto_msgTypes[19].OneofWrappers = []any{ (*NGINXPlusAction_UpdateHttpUpstreamServers)(nil), (*NGINXPlusAction_GetHttpUpstreamServers)(nil), (*NGINXPlusAction_UpdateStreamServers)(nil), (*NGINXPlusAction_GetUpstreams)(nil), (*NGINXPlusAction_GetStreamUpstreams)(nil), } - file_mpi_v1_command_proto_msgTypes[29].OneofWrappers = []any{ + file_mpi_v1_command_proto_msgTypes[28].OneofWrappers = []any{ (*InstanceConfig_AgentConfig)(nil), } - file_mpi_v1_command_proto_msgTypes[30].OneofWrappers = []any{ + file_mpi_v1_command_proto_msgTypes[29].OneofWrappers = []any{ (*InstanceRuntime_NginxRuntimeInfo)(nil), (*InstanceRuntime_NginxPlusRuntimeInfo)(nil), (*InstanceRuntime_NginxAppProtectRuntimeInfo)(nil), @@ -3365,7 +3310,7 @@ func file_mpi_v1_command_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_mpi_v1_command_proto_rawDesc), len(file_mpi_v1_command_proto_rawDesc)), NumEnums: 3, - NumMessages: 43, + NumMessages: 42, NumExtensions: 0, NumServices: 1, }, diff --git a/api/grpc/mpi/v1/command.pb.validate.go b/api/grpc/mpi/v1/command.pb.validate.go index 35efc898d..ab7777024 100644 --- a/api/grpc/mpi/v1/command.pb.validate.go +++ b/api/grpc/mpi/v1/command.pb.validate.go @@ -1215,23 +1215,22 @@ var _ interface { ErrorName() string } = UpdateDataPlaneStatusResponseValidationError{} -// Validate checks the field values on UpdateNginxAgentConfigurationRequest -// with the rules defined in the proto definition for this message. If any -// rules are violated, the first error encountered is returned, or nil if -// there are no violations. -func (m *UpdateNginxAgentConfigurationRequest) Validate() error { +// Validate checks the field values on UpdateAgentConfigRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *UpdateAgentConfigRequest) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on UpdateNginxAgentConfigurationRequest -// with the rules defined in the proto definition for this message. If any -// rules are violated, the result is a list of violation errors wrapped in -// UpdateNginxAgentConfigurationRequestMultiError, or nil if none found. -func (m *UpdateNginxAgentConfigurationRequest) ValidateAll() error { +// ValidateAll checks the field values on UpdateAgentConfigRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// UpdateAgentConfigRequestMultiError, or nil if none found. +func (m *UpdateAgentConfigRequest) ValidateAll() error { return m.validate(true) } -func (m *UpdateNginxAgentConfigurationRequest) validate(all bool) error { +func (m *UpdateAgentConfigRequest) validate(all bool) error { if m == nil { return nil } @@ -1242,7 +1241,7 @@ func (m *UpdateNginxAgentConfigurationRequest) validate(all bool) error { switch v := interface{}(m.GetMessageMeta()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdateNginxAgentConfigurationRequestValidationError{ + errors = append(errors, UpdateAgentConfigRequestValidationError{ field: "MessageMeta", reason: "embedded message failed validation", cause: err, @@ -1250,7 +1249,7 @@ func (m *UpdateNginxAgentConfigurationRequest) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, UpdateNginxAgentConfigurationRequestValidationError{ + errors = append(errors, UpdateAgentConfigRequestValidationError{ field: "MessageMeta", reason: "embedded message failed validation", cause: err, @@ -1259,7 +1258,7 @@ func (m *UpdateNginxAgentConfigurationRequest) validate(all bool) error { } } else if v, ok := interface{}(m.GetMessageMeta()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return UpdateNginxAgentConfigurationRequestValidationError{ + return UpdateAgentConfigRequestValidationError{ field: "MessageMeta", reason: "embedded message failed validation", cause: err, @@ -1271,7 +1270,7 @@ func (m *UpdateNginxAgentConfigurationRequest) validate(all bool) error { switch v := interface{}(m.GetAgentConfig()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdateNginxAgentConfigurationRequestValidationError{ + errors = append(errors, UpdateAgentConfigRequestValidationError{ field: "AgentConfig", reason: "embedded message failed validation", cause: err, @@ -1279,7 +1278,7 @@ func (m *UpdateNginxAgentConfigurationRequest) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, UpdateNginxAgentConfigurationRequestValidationError{ + errors = append(errors, UpdateAgentConfigRequestValidationError{ field: "AgentConfig", reason: "embedded message failed validation", cause: err, @@ -1288,7 +1287,7 @@ func (m *UpdateNginxAgentConfigurationRequest) validate(all bool) error { } } else if v, ok := interface{}(m.GetAgentConfig()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return UpdateNginxAgentConfigurationRequestValidationError{ + return UpdateAgentConfigRequestValidationError{ field: "AgentConfig", reason: "embedded message failed validation", cause: err, @@ -1297,20 +1296,19 @@ func (m *UpdateNginxAgentConfigurationRequest) validate(all bool) error { } if len(errors) > 0 { - return UpdateNginxAgentConfigurationRequestMultiError(errors) + return UpdateAgentConfigRequestMultiError(errors) } return nil } -// UpdateNginxAgentConfigurationRequestMultiError is an error wrapping multiple -// validation errors returned by -// UpdateNginxAgentConfigurationRequest.ValidateAll() if the designated +// UpdateAgentConfigRequestMultiError is an error wrapping multiple validation +// errors returned by UpdateAgentConfigRequest.ValidateAll() if the designated // constraints aren't met. -type UpdateNginxAgentConfigurationRequestMultiError []error +type UpdateAgentConfigRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m UpdateNginxAgentConfigurationRequestMultiError) Error() string { +func (m UpdateAgentConfigRequestMultiError) Error() string { msgs := make([]string, 0, len(m)) for _, err := range m { msgs = append(msgs, err.Error()) @@ -1319,146 +1317,11 @@ func (m UpdateNginxAgentConfigurationRequestMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m UpdateNginxAgentConfigurationRequestMultiError) AllErrors() []error { return m } - -// UpdateNginxAgentConfigurationRequestValidationError is the validation error -// returned by UpdateNginxAgentConfigurationRequest.Validate if the designated -// constraints aren't met. -type UpdateNginxAgentConfigurationRequestValidationError struct { - field string - reason string - cause error - key bool -} +func (m UpdateAgentConfigRequestMultiError) AllErrors() []error { return m } -// Field function returns field value. -func (e UpdateNginxAgentConfigurationRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdateNginxAgentConfigurationRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdateNginxAgentConfigurationRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdateNginxAgentConfigurationRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdateNginxAgentConfigurationRequestValidationError) ErrorName() string { - return "UpdateNginxAgentConfigurationRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdateNginxAgentConfigurationRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUpdateNginxAgentConfigurationRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdateNginxAgentConfigurationRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdateNginxAgentConfigurationRequestValidationError{} - -// Validate checks the field values on UpdateNginxAgentConfigurationResponse -// with the rules defined in the proto definition for this message. If any -// rules are violated, the first error encountered is returned, or nil if -// there are no violations. -func (m *UpdateNginxAgentConfigurationResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdateNginxAgentConfigurationResponse -// with the rules defined in the proto definition for this message. If any -// rules are violated, the result is a list of violation errors wrapped in -// UpdateNginxAgentConfigurationResponseMultiError, or nil if none found. -func (m *UpdateNginxAgentConfigurationResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdateNginxAgentConfigurationResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetResponse()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UpdateNginxAgentConfigurationResponseValidationError{ - field: "Response", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UpdateNginxAgentConfigurationResponseValidationError{ - field: "Response", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UpdateNginxAgentConfigurationResponseValidationError{ - field: "Response", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return UpdateNginxAgentConfigurationResponseMultiError(errors) - } - - return nil -} - -// UpdateNginxAgentConfigurationResponseMultiError is an error wrapping -// multiple validation errors returned by -// UpdateNginxAgentConfigurationResponse.ValidateAll() if the designated -// constraints aren't met. -type UpdateNginxAgentConfigurationResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdateNginxAgentConfigurationResponseMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UpdateNginxAgentConfigurationResponseMultiError) AllErrors() []error { return m } - -// UpdateNginxAgentConfigurationResponseValidationError is the validation error -// returned by UpdateNginxAgentConfigurationResponse.Validate if the -// designated constraints aren't met. -type UpdateNginxAgentConfigurationResponseValidationError struct { +// UpdateAgentConfigRequestValidationError is the validation error returned by +// UpdateAgentConfigRequest.Validate if the designated constraints aren't met. +type UpdateAgentConfigRequestValidationError struct { field string reason string cause error @@ -1466,24 +1329,24 @@ type UpdateNginxAgentConfigurationResponseValidationError struct { } // Field function returns field value. -func (e UpdateNginxAgentConfigurationResponseValidationError) Field() string { return e.field } +func (e UpdateAgentConfigRequestValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e UpdateNginxAgentConfigurationResponseValidationError) Reason() string { return e.reason } +func (e UpdateAgentConfigRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e UpdateNginxAgentConfigurationResponseValidationError) Cause() error { return e.cause } +func (e UpdateAgentConfigRequestValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e UpdateNginxAgentConfigurationResponseValidationError) Key() bool { return e.key } +func (e UpdateAgentConfigRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e UpdateNginxAgentConfigurationResponseValidationError) ErrorName() string { - return "UpdateNginxAgentConfigurationResponseValidationError" +func (e UpdateAgentConfigRequestValidationError) ErrorName() string { + return "UpdateAgentConfigRequestValidationError" } // Error satisfies the builtin error interface -func (e UpdateNginxAgentConfigurationResponseValidationError) Error() string { +func (e UpdateAgentConfigRequestValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -1495,14 +1358,14 @@ func (e UpdateNginxAgentConfigurationResponseValidationError) Error() string { } return fmt.Sprintf( - "invalid %sUpdateNginxAgentConfigurationResponse.%s: %s%s", + "invalid %sUpdateAgentConfigRequest.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = UpdateNginxAgentConfigurationResponseValidationError{} +var _ error = UpdateAgentConfigRequestValidationError{} var _ interface { Field() string @@ -1510,7 +1373,7 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = UpdateNginxAgentConfigurationResponseValidationError{} +} = UpdateAgentConfigRequestValidationError{} // Validate checks the field values on InstanceHealth with the rules defined in // the proto definition for this message. If any rules are violated, the first @@ -2347,7 +2210,7 @@ func (m *ManagementPlaneRequest) validate(all bool) error { } } - case *ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest: + case *ManagementPlaneRequest_UpdateAgentConfigRequest: if v == nil { err := ManagementPlaneRequestValidationError{ field: "Request", @@ -2360,11 +2223,11 @@ func (m *ManagementPlaneRequest) validate(all bool) error { } if all { - switch v := interface{}(m.GetUpdateNginxAgentConfigurationRequest()).(type) { + switch v := interface{}(m.GetUpdateAgentConfigRequest()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ManagementPlaneRequestValidationError{ - field: "UpdateNginxAgentConfigurationRequest", + field: "UpdateAgentConfigRequest", reason: "embedded message failed validation", cause: err, }) @@ -2372,16 +2235,16 @@ func (m *ManagementPlaneRequest) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ManagementPlaneRequestValidationError{ - field: "UpdateNginxAgentConfigurationRequest", + field: "UpdateAgentConfigRequest", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetUpdateNginxAgentConfigurationRequest()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetUpdateAgentConfigRequest()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ManagementPlaneRequestValidationError{ - field: "UpdateNginxAgentConfigurationRequest", + field: "UpdateAgentConfigRequest", reason: "embedded message failed validation", cause: err, } diff --git a/api/grpc/mpi/v1/command.proto b/api/grpc/mpi/v1/command.proto index 4c4d2ab05..0456757ad 100644 --- a/api/grpc/mpi/v1/command.proto +++ b/api/grpc/mpi/v1/command.proto @@ -113,18 +113,13 @@ message UpdateDataPlaneStatusRequest { // Respond to a UpdateDataPlaneStatusRequest - intentionally empty message UpdateDataPlaneStatusResponse {} -message UpdateNginxAgentConfigurationRequest { +message UpdateAgentConfigRequest { // Meta-information associated with a message mpi.v1.MessageMeta message_meta = 1; - // the NGINX Agent configuration to update + // The NGINX Agent configuration to update AgentConfig agent_config = 2; } -message UpdateNginxAgentConfigurationResponse { - // The success or failure of the UpdateNginxAgentConfigurationRequest - mpi.v1.CommandResponse response = 1; -} - message InstanceHealth { // Health status enum enum InstanceHealthStatus { @@ -183,8 +178,8 @@ message ManagementPlaneRequest { APIActionRequest action_request = 7; // triggers a DataPlaneResponse with a command_response for a particular correlation_id CommandStatusRequest command_status_request = 8; - // triggers an UpdateNginxAgentConfiguration rpc, returning an UpdateNginxAgentConfigurationResponse - UpdateNginxAgentConfigurationRequest update_nginx_agent_configuration_request = 9; + // triggers an update to the NGINX Agent configuration + UpdateAgentConfigRequest update_agent_config_request = 9; } } @@ -409,16 +404,14 @@ message AgentConfig { message Log { LogLevel log_level = 1; enum LogLevel { - // Unspecified log level - LOG_LEVEL_UNSPECIFIED = 0; + // Info log level + LOG_LEVEL_INFO = 0; // Error log level LOG_LEVEL_ERROR = 1; // Warning log level LOG_LEVEL_WARN = 2; - // Info log level - LOG_LEVEL_INFO = 3; // Debug log level - LOG_LEVEL_DEBUG = 4; + LOG_LEVEL_DEBUG = 3; } string log_path = 2; } diff --git a/docs/proto/protos.md b/docs/proto/protos.md index 05c8850cf..18301abd5 100644 --- a/docs/proto/protos.md +++ b/docs/proto/protos.md @@ -77,13 +77,12 @@ - [ReleaseInfo](#mpi-v1-ReleaseInfo) - [Resource](#mpi-v1-Resource) - [StatusRequest](#mpi-v1-StatusRequest) + - [UpdateAgentConfigRequest](#mpi-v1-UpdateAgentConfigRequest) - [UpdateDataPlaneHealthRequest](#mpi-v1-UpdateDataPlaneHealthRequest) - [UpdateDataPlaneHealthResponse](#mpi-v1-UpdateDataPlaneHealthResponse) - [UpdateDataPlaneStatusRequest](#mpi-v1-UpdateDataPlaneStatusRequest) - [UpdateDataPlaneStatusResponse](#mpi-v1-UpdateDataPlaneStatusResponse) - [UpdateHTTPUpstreamServers](#mpi-v1-UpdateHTTPUpstreamServers) - - [UpdateNginxAgentConfigurationRequest](#mpi-v1-UpdateNginxAgentConfigurationRequest) - - [UpdateNginxAgentConfigurationResponse](#mpi-v1-UpdateNginxAgentConfigurationResponse) - [UpdateStreamServers](#mpi-v1-UpdateStreamServers) - [InstanceHealth.InstanceHealthStatus](#mpi-v1-InstanceHealth-InstanceHealthStatus) @@ -1085,7 +1084,7 @@ A Management Plane request for information, triggers an associated rpc on the Da | config_upload_request | [ConfigUploadRequest](#mpi-v1-ConfigUploadRequest) | | triggers a series of rpc UpdateFile(File) for that instances | | action_request | [APIActionRequest](#mpi-v1-APIActionRequest) | | triggers a DataPlaneResponse with a command_response for a particular action | | command_status_request | [CommandStatusRequest](#mpi-v1-CommandStatusRequest) | | triggers a DataPlaneResponse with a command_response for a particular correlation_id | -| update_nginx_agent_configuration_request | [UpdateNginxAgentConfigurationRequest](#mpi-v1-UpdateNginxAgentConfigurationRequest) | | triggers an UpdateNginxAgentConfiguration rpc, returning an UpdateNginxAgentConfigurationResponse | +| update_agent_config_request | [UpdateAgentConfigRequest](#mpi-v1-UpdateAgentConfigRequest) | | triggers an update to the NGINX Agent configuration | @@ -1225,6 +1224,22 @@ Additional information associated with a StatusRequest + + +### UpdateAgentConfigRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| message_meta | [MessageMeta](#mpi-v1-MessageMeta) | | Meta-information associated with a message | +| agent_config | [AgentConfig](#mpi-v1-AgentConfig) | | The NGINX Agent configuration to update | + + + + + + ### UpdateDataPlaneHealthRequest @@ -1293,37 +1308,6 @@ Update HTTP Upstream Servers for an instance - - -### UpdateNginxAgentConfigurationRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| message_meta | [MessageMeta](#mpi-v1-MessageMeta) | | Meta-information associated with a message | -| agent_config | [AgentConfig](#mpi-v1-AgentConfig) | | the NGINX Agent configuration to update | - - - - - - - - -### UpdateNginxAgentConfigurationResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| response | [CommandResponse](#mpi-v1-CommandResponse) | | The success or failure of the UpdateNginxAgentConfigurationRequest | - - - - - - ### UpdateStreamServers @@ -1379,11 +1363,10 @@ the types of instances possible | Name | Number | Description | | ---- | ------ | ----------- | -| LOG_LEVEL_UNSPECIFIED | 0 | Unspecified log level | +| LOG_LEVEL_INFO | 0 | Info log level | | LOG_LEVEL_ERROR | 1 | Error log level | | LOG_LEVEL_WARN | 2 | Warning log level | -| LOG_LEVEL_INFO | 3 | Info log level | -| LOG_LEVEL_DEBUG | 4 | Debug log level | +| LOG_LEVEL_DEBUG | 3 | Debug log level | diff --git a/internal/collector/otel_collector_plugin.go b/internal/collector/otel_collector_plugin.go index e102b9328..23932f9a3 100644 --- a/internal/collector/otel_collector_plugin.go +++ b/internal/collector/otel_collector_plugin.go @@ -55,6 +55,7 @@ type ( service types.CollectorInterface config *config.Config mu *sync.Mutex + agentConfigMutex *sync.Mutex cancel context.CancelFunc previousNAPSysLogServer string debugOTelConfigPath string @@ -334,6 +335,10 @@ func (oc *Collector) handleResourceUpdate(ctx context.Context, msg *bus.Message) func (oc *Collector) handleAgentConfigUpdate(ctx context.Context, msg *bus.Message) { slog.DebugContext(ctx, "OTel collector plugin received agent config update message") + + oc.agentConfigMutex.Lock() + defer oc.agentConfigMutex.Unlock() + agentConfig, ok := msg.Data.(*config.Config) if !ok { slog.ErrorContext(ctx, "Unable to cast message payload to *config.Config", "payload", msg.Data) diff --git a/internal/command/command_plugin.go b/internal/command/command_plugin.go index 6c32a8a57..15537b0e5 100644 --- a/internal/command/command_plugin.go +++ b/internal/command/command_plugin.go @@ -281,7 +281,7 @@ func (cp *CommandPlugin) processConnectionReset(ctx context.Context, msg *bus.Me } } -//nolint:revive // cognitive complexity is 14 +//nolint:revive,cyclop // cognitive complexity is 14 func (cp *CommandPlugin) monitorSubscribeChannel(ctx context.Context) { for { select { @@ -324,8 +324,16 @@ func (cp *CommandPlugin) monitorSubscribeChannel(ctx context.Context) { } slog.InfoContext(ctx, "Received management plane action request") cp.handleAPIActionRequest(newCtx, message) - case *mpi.ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest: - slog.InfoContext(ctx, "Received management plane request - update agent configuration") + case *mpi.ManagementPlaneRequest_UpdateAgentConfigRequest: + slog.InfoContext(ctx, "Received management plane update agent config request") + if cp.commandServerType != model.Command { + slog.WarnContext(newCtx, "Auxiliary command server can not perform agent config update", + "command_server_type", cp.commandServerType.String()) + cp.handleInvalidRequest(newCtx, message, "Updating agent config failed", "") + + return + } + cp.handleAgentConfigUpdateRequest(newCtx, message) default: slog.DebugContext(newCtx, "Management plane request not implemented yet") @@ -433,10 +441,10 @@ func (cp *CommandPlugin) handleInvalidRequest(ctx context.Context, func (cp *CommandPlugin) handleAgentConfigUpdateRequest(ctx context.Context, request *mpi.ManagementPlaneRequest) { newAgentConfig, err := cp.commandService.UpdateAgentConfig( ctx, - request.GetUpdateNginxAgentConfigurationRequest().GetAgentConfig(), + request.GetUpdateAgentConfigRequest().GetAgentConfig(), ) if err != nil { - slog.ErrorContext(ctx, "Command service was unable to update agent configuration", "error", err) + slog.ErrorContext(ctx, "Unable to update agent configuration", "error", err) responseError := cp.commandService.SendDataPlaneResponse(ctx, &mpi.DataPlaneResponse{ MessageMeta: &mpi.MessageMeta{ @@ -454,7 +462,7 @@ func (cp *CommandPlugin) handleAgentConfigUpdateRequest(ctx context.Context, req slog.ErrorContext(ctx, "Unable to send data plane response", "error", responseError) } } else { - cp.Process(ctx, &bus.Message{Topic: bus.AgentConfigUpdateTopic, Data: newAgentConfig}) + cp.messagePipe.Process(ctx, &bus.Message{Topic: bus.AgentConfigUpdateTopic, Data: newAgentConfig}) responseError := cp.commandService.SendDataPlaneResponse(ctx, &mpi.DataPlaneResponse{ MessageMeta: &mpi.MessageMeta{ diff --git a/internal/command/command_plugin_test.go b/internal/command/command_plugin_test.go index b6e988753..885b4e979 100644 --- a/internal/command/command_plugin_test.go +++ b/internal/command/command_plugin_test.go @@ -8,6 +8,7 @@ package command import ( "bytes" "context" + "log/slog" "testing" "time" @@ -167,6 +168,10 @@ func TestCommandPlugin_Process(t *testing.T) { } func TestCommandPlugin_monitorSubscribeChannel(t *testing.T) { + defer func() { + slog.SetDefault(slog.Default()) + }() + tests := []struct { managementPlaneRequest *mpi.ManagementPlaneRequest expectedTopic *bus.Message @@ -224,6 +229,24 @@ func TestCommandPlugin_monitorSubscribeChannel(t *testing.T) { pkg.FeatureAPIAction, }, }, + + { + name: "Test 5: Update Agent Config Request", + managementPlaneRequest: &mpi.ManagementPlaneRequest{ + Request: &mpi.ManagementPlaneRequest_UpdateAgentConfigRequest{ + UpdateAgentConfigRequest: &mpi.UpdateAgentConfigRequest{ + AgentConfig: &mpi.AgentConfig{ + Log: &mpi.Log{ + LogLevel: mpi.Log_LOG_LEVEL_DEBUG, + }, + }, + }, + }, + }, + expectedTopic: &bus.Message{Topic: bus.AgentConfigUpdateTopic}, + request: "UpdateAgentConfigRequest", + configFeatures: config.DefaultFeatures(), + }, } for _, test := range tests { @@ -254,18 +277,24 @@ func TestCommandPlugin_monitorSubscribeChannel(t *testing.T) { assert.Len(tt, messages, 1) assert.Equal(tt, test.expectedTopic.Topic, messages[0].Topic) - mp, ok := messages[0].Data.(*mpi.ManagementPlaneRequest) - - switch test.request { - case "UploadRequest": - assert.True(tt, ok) - require.NotNil(tt, mp.GetConfigUploadRequest()) - case "ApplyRequest": - assert.True(tt, ok) - require.NotNil(tt, mp.GetConfigApplyRequest()) - case "APIActionRequest": + if test.request == "UpdateAgentConfigRequest" { + data, ok := messages[0].Data.(*config.Config) assert.True(tt, ok) - require.NotNil(tt, mp.GetActionRequest()) + require.NotNil(tt, data) + } else { + mp, ok := messages[0].Data.(*mpi.ManagementPlaneRequest) + + switch test.request { + case "UploadRequest": + assert.True(tt, ok) + require.NotNil(tt, mp.GetConfigUploadRequest()) + case "ApplyRequest": + assert.True(tt, ok) + require.NotNil(tt, mp.GetConfigApplyRequest()) + case "APIActionRequest": + assert.True(tt, ok) + require.NotNil(tt, mp.GetActionRequest()) + } } }) } diff --git a/internal/command/command_service.go b/internal/command/command_service.go index a196474b7..a2e61a435 100644 --- a/internal/command/command_service.go +++ b/internal/command/command_service.go @@ -187,9 +187,6 @@ func (cs *CommandService) UpdateAgentConfig( ctx context.Context, mpiConfig *mpi.AgentConfig, ) (*config.Config, error) { - if !cs.isConnected.Load() { - return nil, errors.New("command service client not connected yet") - } slog.InfoContext(ctx, "Updating agent configuration", "config", mpiConfig) updatedLog := config.FromAgentConfigLogProto(mpiConfig.GetLog()) diff --git a/internal/config/mapper.go b/internal/config/mapper.go index d47ff7cf1..641744be1 100644 --- a/internal/config/mapper.go +++ b/internal/config/mapper.go @@ -124,17 +124,17 @@ func ToAuxiliaryCommandServerProto(cmd *Command) *mpi.AuxiliaryCommandServer { return protoConfig } -func FromAgentConfigLogProto(mpiLog *mpi.Log) *Log { +func FromAgentConfigLogProto(log *mpi.Log) *Log { return &Log{ - Level: MapConfigLogLevelToSlogLevel(mpiLog.GetLogLevel()), - Path: mpiLog.GetLogPath(), + Level: MapConfigLogLevelToSlogLevel(log.GetLogLevel()), + Path: log.GetLogPath(), } } -func ToAgentConfigLogProto(agentLogConfig *Log) *mpi.Log { +func ToAgentConfigLogProto(log *Log) *mpi.Log { return &mpi.Log{ - LogLevel: MapSlogLevelToConfigLogLevel(agentLogConfig.Level), - LogPath: agentLogConfig.Path, + LogLevel: MapSlogLevelToConfigLogLevel(log.Level), + LogPath: log.Path, } } @@ -148,7 +148,7 @@ func MapConfigLogLevelToSlogLevel(level mpi.Log_LogLevel) string { slogLevel = "WARN" case mpi.Log_LOG_LEVEL_ERROR: slogLevel = "ERROR" - case mpi.Log_LOG_LEVEL_INFO, mpi.Log_LOG_LEVEL_UNSPECIFIED: + case mpi.Log_LOG_LEVEL_INFO: } return slogLevel @@ -158,13 +158,11 @@ func MapSlogLevelToConfigLogLevel(level string) mpi.Log_LogLevel { switch strings.ToUpper(level) { case "DEBUG": return mpi.Log_LOG_LEVEL_DEBUG - case "INFO": - return mpi.Log_LOG_LEVEL_INFO case "WARN": return mpi.Log_LOG_LEVEL_WARN case "ERROR": return mpi.Log_LOG_LEVEL_ERROR default: - return mpi.Log_LOG_LEVEL_UNSPECIFIED + return mpi.Log_LOG_LEVEL_INFO } } diff --git a/internal/config/mapper_test.go b/internal/config/mapper_test.go index f220ddcce..263608489 100644 --- a/internal/config/mapper_test.go +++ b/internal/config/mapper_test.go @@ -267,27 +267,7 @@ func TestMapper_ToAgentConfigLogProto(t *testing.T) { }, }, { - name: "Test 5: Log level UNKNOWN", - log: &Log{ - Level: "UNKNOWN", - }, - expected: &mpi.Log{ - LogLevel: mpi.Log_LOG_LEVEL_UNSPECIFIED, - LogPath: "", - }, - }, - { - name: "Test 6: Log level empty", - log: &Log{ - Level: "", - }, - expected: &mpi.Log{ - LogLevel: mpi.Log_LOG_LEVEL_UNSPECIFIED, - LogPath: "", - }, - }, - { - name: "Test 7: Log path set", + name: "Test 5: Log path set", log: &Log{ Level: "INFO", Path: "/path/to/agent.log", @@ -298,7 +278,7 @@ func TestMapper_ToAgentConfigLogProto(t *testing.T) { }, }, { - name: "Test 8: Log path empty", + name: "Test 6: Log path empty", log: &Log{ Level: "INFO", Path: "", @@ -309,7 +289,7 @@ func TestMapper_ToAgentConfigLogProto(t *testing.T) { }, }, { - name: "Test 9: Both log level and path set", + name: "Test 7: Both log level and path set", log: &Log{ Level: "DEBUG", Path: "/other/path/to/agent.log", diff --git a/internal/file/file_plugin.go b/internal/file/file_plugin.go index 4a94eecac..0b76d19e9 100644 --- a/internal/file/file_plugin.go +++ b/internal/file/file_plugin.go @@ -29,6 +29,7 @@ var _ bus.Plugin = (*FilePlugin)(nil) type FilePlugin struct { manifestLock *sync.RWMutex + agentConfigMutex *sync.Mutex messagePipe bus.MessagePipeInterface config *config.Config conn grpc.GrpcConnectionInterface @@ -416,6 +417,10 @@ func (fp *FilePlugin) handleConfigUploadRequest(ctx context.Context, msg *bus.Me func (fp *FilePlugin) handleAgentConfigUpdate(ctx context.Context, msg *bus.Message) { slog.DebugContext(ctx, "File plugin received agent config update message") + + fp.agentConfigMutex.Lock() + defer fp.agentConfigMutex.Unlock() + agentConfig, ok := msg.Data.(*config.Config) if !ok { slog.ErrorContext(ctx, "Unable to cast message payload to *config.Config", "payload", msg.Data) diff --git a/internal/resource/resource_plugin.go b/internal/resource/resource_plugin.go index 908abed59..c76138333 100644 --- a/internal/resource/resource_plugin.go +++ b/internal/resource/resource_plugin.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "log/slog" + "sync" mpi "github.com/nginx/agent/v3/api/grpc/mpi/v1" "github.com/nginx/agent/v3/internal/config" @@ -25,9 +26,10 @@ import ( // This is done in the resource plugin to make the file plugin usable for every type of instance. type Resource struct { - messagePipe bus.MessagePipeInterface - resourceService resourceServiceInterface - agentConfig *config.Config + messagePipe bus.MessagePipeInterface + resourceService resourceServiceInterface + agentConfig *config.Config + agentConfigMutex *sync.Mutex } type errResponse struct { @@ -287,6 +289,10 @@ func (r *Resource) handleRollbackWrite(ctx context.Context, msg *bus.Message) { func (r *Resource) handleAgentConfigUpdate(ctx context.Context, msg *bus.Message) { slog.DebugContext(ctx, "Resource plugin received agent config update message") + + r.agentConfigMutex.Lock() + defer r.agentConfigMutex.Unlock() + agentConfig, ok := msg.Data.(*config.Config) if !ok { slog.ErrorContext(ctx, "Unable to cast message payload to *config.Config", "payload", msg.Data) diff --git a/internal/watcher/watcher_plugin.go b/internal/watcher/watcher_plugin.go index 769bdc692..daa3ffdf0 100644 --- a/internal/watcher/watcher_plugin.go +++ b/internal/watcher/watcher_plugin.go @@ -49,6 +49,7 @@ type ( cancel context.CancelFunc instancesWithConfigApplyInProgress []string watcherMutex sync.Mutex + agentConfigMutex sync.Mutex } instanceWatcherServiceInterface interface { @@ -320,6 +321,10 @@ func (w *Watcher) handleInstanceUpdates(newCtx context.Context, message instance func (w *Watcher) handleAgentConfigUpdate(ctx context.Context, msg *bus.Message) { slog.DebugContext(ctx, "Watcher plugin received agent config update message") + + w.agentConfigMutex.Lock() + defer w.agentConfigMutex.Unlock() + agentConfig, ok := msg.Data.(*config.Config) if !ok { slog.ErrorContext(ctx, "Unable to cast message payload to *config.Config", "payload", msg.Data) diff --git a/test/protos/management_plane_request.go b/test/protos/management_plane_request.go index d9b37fffa..ce32e113a 100644 --- a/test/protos/management_plane_request.go +++ b/test/protos/management_plane_request.go @@ -127,8 +127,8 @@ func CreateAPIActionRequestNginxPlusUpdateStreamServers(upstream, instanceID str func CreateAgentConfigurationUpdateRequest(config *mpi.AgentConfig) *mpi.ManagementPlaneRequest { return &mpi.ManagementPlaneRequest{ MessageMeta: CreateMessageMeta(), - Request: &mpi.ManagementPlaneRequest_UpdateNginxAgentConfigurationRequest{ - UpdateNginxAgentConfigurationRequest: &mpi.UpdateNginxAgentConfigurationRequest{ + Request: &mpi.ManagementPlaneRequest_UpdateAgentConfigRequest{ + UpdateAgentConfigRequest: &mpi.UpdateAgentConfigRequest{ AgentConfig: config, }, }, From b5fb1ce5f4fe3c6698f71b0779d5c8c01685871a Mon Sep 17 00:00:00 2001 From: Donal Hurley Date: Tue, 11 Nov 2025 15:14:19 +0000 Subject: [PATCH 4/7] Clean up --- internal/collector/otel_collector_plugin.go | 1 + internal/file/file_plugin.go | 9 +++++---- internal/watcher/watcher_plugin.go | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/collector/otel_collector_plugin.go b/internal/collector/otel_collector_plugin.go index 23932f9a3..07a05f4db 100644 --- a/internal/collector/otel_collector_plugin.go +++ b/internal/collector/otel_collector_plugin.go @@ -101,6 +101,7 @@ func NewCollector(conf *config.Config) (*Collector, error) { service: oTelCollector, stopped: true, mu: &sync.Mutex{}, + agentConfigMutex: &sync.Mutex{}, previousNAPSysLogServer: "", debugOTelConfigPath: debugOTelConfigPath, }, nil diff --git a/internal/file/file_plugin.go b/internal/file/file_plugin.go index 0b76d19e9..7a2fa208d 100644 --- a/internal/file/file_plugin.go +++ b/internal/file/file_plugin.go @@ -41,10 +41,11 @@ func NewFilePlugin(agentConfig *config.Config, grpcConnection grpc.GrpcConnectio serverType model.ServerType, manifestLock *sync.RWMutex, ) *FilePlugin { return &FilePlugin{ - config: agentConfig, - conn: grpcConnection, - serverType: serverType, - manifestLock: manifestLock, + config: agentConfig, + conn: grpcConnection, + serverType: serverType, + manifestLock: manifestLock, + agentConfigMutex: &sync.Mutex{}, } } diff --git a/internal/watcher/watcher_plugin.go b/internal/watcher/watcher_plugin.go index daa3ffdf0..c6af0dc00 100644 --- a/internal/watcher/watcher_plugin.go +++ b/internal/watcher/watcher_plugin.go @@ -90,6 +90,7 @@ func NewWatcher(agentConfig *config.Config) *Watcher { auxiliaryCredentialUpdatesChannel: make(chan credentials.CredentialUpdateMessage), instancesWithConfigApplyInProgress: []string{}, watcherMutex: sync.Mutex{}, + agentConfigMutex: sync.Mutex{}, } } From 204c1e3ecfdc7b25155d9749c7194597dfc5e94e Mon Sep 17 00:00:00 2001 From: Donal Hurley Date: Tue, 11 Nov 2025 16:42:13 +0000 Subject: [PATCH 5/7] Clean up --- internal/resource/resource_plugin.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/resource/resource_plugin.go b/internal/resource/resource_plugin.go index c76138333..d1b5fcc7a 100644 --- a/internal/resource/resource_plugin.go +++ b/internal/resource/resource_plugin.go @@ -48,7 +48,8 @@ var _ bus.Plugin = (*Resource)(nil) func NewResource(agentConfig *config.Config) *Resource { return &Resource{ - agentConfig: agentConfig, + agentConfig: agentConfig, + agentConfigMutex: &sync.Mutex{}, } } From e708254bf45a680e89795e4ef07d9d20ee447d63 Mon Sep 17 00:00:00 2001 From: Donal Hurley Date: Thu, 13 Nov 2025 10:37:48 +0000 Subject: [PATCH 6/7] Fix integration test --- .../managementplane/grpc_management_plane_api_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/integration/managementplane/grpc_management_plane_api_test.go b/test/integration/managementplane/grpc_management_plane_api_test.go index e13ef0f94..b3845b461 100644 --- a/test/integration/managementplane/grpc_management_plane_api_test.go +++ b/test/integration/managementplane/grpc_management_plane_api_test.go @@ -79,14 +79,14 @@ func (s *MPITestSuite) TestGrpc_Test4_UpdateNginxAgentConfigurationRequest() { slog.Info("starting grpc update nginx agent configuration request test") request := `{ "message_meta": { - "message_id": "5d0fa83e-351c-4009-90cd-1f2acce2d184", - "correlation_id": "79794c1c-8e91-47c1-a92c-b9a0c3f1a263", - "timestamp": "2023-01-15T01:30:15.01Z" + "message_id": "6c0fa83e-351c-4009-90cd-1f2acce2d184", + "correlation_id": "11114c1c-8e91-47c1-a92c-b9a0c3f1a263", + "timestamp": "2025-01-15T01:30:15.01Z" }, - "update_nginx_agent_configuration_request": { + "update_agent_config_request": { "agent_config": { "log": { - "log_level": 4 + "log_level": 1 } } } From 5479bcfeaf25efbe43a8305325ba91e465d2cd6c Mon Sep 17 00:00:00 2001 From: Donal Hurley Date: Wed, 19 Nov 2025 14:00:22 +0000 Subject: [PATCH 7/7] Update README --- test/mock/grpc/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/mock/grpc/README.md b/test/mock/grpc/README.md index dae3cdcd7..716f15f34 100644 --- a/test/mock/grpc/README.md +++ b/test/mock/grpc/README.md @@ -413,6 +413,25 @@ Example request body to get stream upstreams example: } } ``` + +Example remote agent config update to change log level to debug: +``` +{ + "message_meta": { + "message_id": "6c0fa83e-351c-4009-90cd-1f2acce2d184", + "correlation_id": "11114c1c-8e91-47c1-a92c-b9a0c3f1a263", + "timestamp": "2025-01-15T01:30:15.01Z" + }, + "update_agent_config_request": { + "agent_config": { + "log": { + "log_level": 3 + } + } + } +} +``` + ## POST /api/v1/instance/\/config/apply Used to send management plane config apply request over the Subscribe rpc stream to the NGINX Agent for a particular data plane instance.