diff --git a/coconut/control/control.go b/coconut/control/control.go index 8e82b93d..01a18b49 100644 --- a/coconut/control/control.go +++ b/coconut/control/control.go @@ -40,6 +40,7 @@ import ( "text/template" "time" + commonpb "github.com/AliceO2Group/Control/common/protos" "github.com/fatih/color" "github.com/xlab/treeprint" @@ -365,7 +366,13 @@ func CreateEnvironment(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.C WithError(err). Fatal("command finished with error") } - _, err = rpc.NewAutoEnvironment(cxt, &pb.NewAutoEnvironmentRequest{WorkflowTemplate: wfPath, Vars: extraVarsMap, Id: id}, grpc.EmptyCallOption{}) + _, err = rpc.NewAutoEnvironment(cxt, &pb.NewAutoEnvironmentRequest{ + WorkflowTemplate: wfPath, + Vars: extraVarsMap, + Id: id, + RequestUser: &commonpb.User{ + Name: getUserAndHost(), + }}, grpc.EmptyCallOption{}) if err != nil { return err } @@ -424,9 +431,23 @@ func CreateEnvironment(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.C var response *pb.NewEnvironmentReply if asynchronous { - response, err = rpc.NewEnvironmentAsync(cxt, &pb.NewEnvironmentRequest{WorkflowTemplate: wfPath, Vars: extraVarsMap, Public: public}, grpc.EmptyCallOption{}) + response, err = rpc.NewEnvironmentAsync(cxt, &pb.NewEnvironmentRequest{ + WorkflowTemplate: wfPath, + Vars: extraVarsMap, + Public: public, + RequestUser: &commonpb.User{ + Name: getUserAndHost(), + }, + }, grpc.EmptyCallOption{}) } else { - response, err = rpc.NewEnvironment(cxt, &pb.NewEnvironmentRequest{WorkflowTemplate: wfPath, Vars: extraVarsMap, Public: public}, grpc.EmptyCallOption{}) + response, err = rpc.NewEnvironment(cxt, &pb.NewEnvironmentRequest{ + WorkflowTemplate: wfPath, + Vars: extraVarsMap, + Public: public, + RequestUser: &commonpb.User{ + Name: getUserAndHost(), + }, + }, grpc.EmptyCallOption{}) } if err != nil { return @@ -588,7 +609,13 @@ func ControlEnvironment(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra. } var response *pb.ControlEnvironmentReply - response, err = rpc.ControlEnvironment(cxt, &pb.ControlEnvironmentRequest{Id: args[0], Type: pb.ControlEnvironmentRequest_Optype(pb.ControlEnvironmentRequest_Optype_value[event])}, grpc.EmptyCallOption{}) + response, err = rpc.ControlEnvironment(cxt, &pb.ControlEnvironmentRequest{ + Id: args[0], + Type: pb.ControlEnvironmentRequest_Optype(pb.ControlEnvironmentRequest_Optype_value[event]), + RequestUser: &commonpb.User{ + Name: getUserAndHost(), + }, + }, grpc.EmptyCallOption{}) if err != nil { return } @@ -717,7 +744,15 @@ func DestroyEnvironment(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra. keepTasks = false } - _, err = rpc.DestroyEnvironment(cxt, &pb.DestroyEnvironmentRequest{Id: envId, KeepTasks: keepTasks, AllowInRunningState: allowInRunningState, Force: force}, grpc.EmptyCallOption{}) + _, err = rpc.DestroyEnvironment(cxt, &pb.DestroyEnvironmentRequest{ + Id: envId, + KeepTasks: keepTasks, + AllowInRunningState: allowInRunningState, + Force: force, + RequestUser: &commonpb.User{ + Name: getUserAndHost(), + }, + }, grpc.EmptyCallOption{}) if err != nil { return } diff --git a/coconut/control/controlutil.go b/coconut/control/controlutil.go index a6d719b3..7f6642e0 100644 --- a/coconut/control/controlutil.go +++ b/coconut/control/controlutil.go @@ -28,6 +28,8 @@ import ( "encoding/json" "fmt" "io" + "os" + "os/user" "strconv" "strings" "time" @@ -191,3 +193,20 @@ func formatNumber(numberOfMachines int32) string { } return nMString } + +func getUserAndHost() string { + userName := "unknown" + hostName := "unknown" + + currentUser, err := user.Current() + if err == nil { + userName = currentUser.Username + } + + currentHost, err := os.Hostname() + if err == nil { + hostName = currentHost + } + + return fmt.Sprintf("%s@%s", userName, hostName) +} diff --git a/coconut/protos/o2control.pb.go b/coconut/protos/o2control.pb.go index 8c846cff..dbd2b96e 100644 --- a/coconut/protos/o2control.pb.go +++ b/coconut/protos/o2control.pb.go @@ -998,6 +998,7 @@ type NewEnvironmentRequest struct { Vars map[string]string `protobuf:"bytes,2,rep,name=vars,proto3" json:"vars,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Public bool `protobuf:"varint,3,opt,name=public,proto3" json:"public,omitempty"` AutoTransition bool `protobuf:"varint,4,opt,name=autoTransition,proto3" json:"autoTransition,omitempty"` + RequestUser *protos.User `protobuf:"bytes,5,opt,name=requestUser,proto3" json:"requestUser,omitempty"` } func (x *NewEnvironmentRequest) Reset() { @@ -1060,6 +1061,13 @@ func (x *NewEnvironmentRequest) GetAutoTransition() bool { return false } +func (x *NewEnvironmentRequest) GetRequestUser() *protos.User { + if x != nil { + return x.RequestUser + } + return nil +} + type NewEnvironmentReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1123,6 +1131,7 @@ type NewAutoEnvironmentRequest struct { WorkflowTemplate string `protobuf:"bytes,1,opt,name=workflowTemplate,proto3" json:"workflowTemplate,omitempty"` Vars map[string]string `protobuf:"bytes,2,rep,name=vars,proto3" json:"vars,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` + RequestUser *protos.User `protobuf:"bytes,4,opt,name=requestUser,proto3" json:"requestUser,omitempty"` } func (x *NewAutoEnvironmentRequest) Reset() { @@ -1178,6 +1187,13 @@ func (x *NewAutoEnvironmentRequest) GetId() string { return "" } +func (x *NewAutoEnvironmentRequest) GetRequestUser() *protos.User { + if x != nil { + return x.RequestUser + } + return nil +} + type NewAutoEnvironmentReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1339,8 +1355,9 @@ type ControlEnvironmentRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Type ControlEnvironmentRequest_Optype `protobuf:"varint,2,opt,name=type,proto3,enum=o2control.ControlEnvironmentRequest_Optype" json:"type,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Type ControlEnvironmentRequest_Optype `protobuf:"varint,2,opt,name=type,proto3,enum=o2control.ControlEnvironmentRequest_Optype" json:"type,omitempty"` + RequestUser *protos.User `protobuf:"bytes,3,opt,name=requestUser,proto3" json:"requestUser,omitempty"` } func (x *ControlEnvironmentRequest) Reset() { @@ -1389,6 +1406,13 @@ func (x *ControlEnvironmentRequest) GetType() ControlEnvironmentRequest_Optype { return ControlEnvironmentRequest_NOOP } +func (x *ControlEnvironmentRequest) GetRequestUser() *protos.User { + if x != nil { + return x.RequestUser + } + return nil +} + type ControlEnvironmentReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1663,10 +1687,11 @@ type DestroyEnvironmentRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - KeepTasks bool `protobuf:"varint,2,opt,name=keepTasks,proto3" json:"keepTasks,omitempty"` - AllowInRunningState bool `protobuf:"varint,3,opt,name=allowInRunningState,proto3" json:"allowInRunningState,omitempty"` - Force bool `protobuf:"varint,4,opt,name=force,proto3" json:"force,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + KeepTasks bool `protobuf:"varint,2,opt,name=keepTasks,proto3" json:"keepTasks,omitempty"` + AllowInRunningState bool `protobuf:"varint,3,opt,name=allowInRunningState,proto3" json:"allowInRunningState,omitempty"` + Force bool `protobuf:"varint,4,opt,name=force,proto3" json:"force,omitempty"` + RequestUser *protos.User `protobuf:"bytes,5,opt,name=requestUser,proto3" json:"requestUser,omitempty"` } func (x *DestroyEnvironmentRequest) Reset() { @@ -1729,6 +1754,13 @@ func (x *DestroyEnvironmentRequest) GetForce() bool { return false } +func (x *DestroyEnvironmentRequest) GetRequestUser() *protos.User { + if x != nil { + return x.RequestUser + } + return nil +} + type DestroyEnvironmentReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4277,7 +4309,7 @@ var file_protos_o2control_proto_rawDesc = []byte{ 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0xfc, 0x01, 0x0a, 0x15, 0x4e, 0x65, 0x77, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, + 0xac, 0x02, 0x0a, 0x15, 0x4e, 0x65, 0x77, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, @@ -4289,7 +4321,10 @@ var file_protos_o2control_proto_rawDesc = []byte{ 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x6f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x6f, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x6b, @@ -4299,7 +4334,7 @@ var file_protos_o2control_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x22, 0xd4, 0x01, 0x0a, 0x19, + 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x22, 0x84, 0x02, 0x0a, 0x19, 0x4e, 0x65, 0x77, 0x41, 0x75, 0x74, 0x6f, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, @@ -4309,7 +4344,10 @@ var file_protos_o2control_proto_rawDesc = []byte{ 0x4e, 0x65, 0x77, 0x41, 0x75, 0x74, 0x6f, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x76, 0x61, 0x72, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x1a, 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x0b, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x0b, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, @@ -4330,13 +4368,16 @@ var file_protos_o2control_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x22, 0xdb, 0x01, 0x0a, 0x19, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x45, 0x6e, 0x76, + 0x63, 0x22, 0x8b, 0x02, 0x0a, 0x19, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x6f, 0x32, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x2e, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x22, 0x6d, 0x0a, 0x06, 0x4f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4f, 0x50, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x49, 0x54, 0x59, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x4f, 0x50, @@ -4387,7 +4428,7 @@ var file_protos_o2control_proto_rawDesc = []byte{ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x91, 0x01, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0xc1, 0x01, 0x0a, 0x19, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6b, @@ -4397,7 +4438,10 @@ var file_protos_o2control_proto_rawDesc = []byte{ 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x49, 0x6e, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, - 0x65, 0x22, 0x65, 0x0a, 0x17, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x45, 0x6e, 0x76, 0x69, + 0x65, 0x12, 0x2e, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x22, 0x65, 0x0a, 0x17, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x4a, 0x0a, 0x11, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x32, 0x63, 0x6f, 0x6e, 0x74, @@ -4981,7 +5025,8 @@ var file_protos_o2control_proto_goTypes = []interface{}{ nil, // 77: o2control.RoleInfo.ConsolidatedStackEntry nil, // 78: o2control.WorkflowTemplateInfo.VarSpecMapEntry nil, // 79: o2control.ListIntegratedServicesReply.ServicesEntry - (*protos.Event)(nil), // 80: events.Event + (*protos.User)(nil), // 80: common.User + (*protos.Event)(nil), // 81: events.Event } var file_protos_o2control_proto_depIdxs = []int32{ 6, // 0: o2control.GetFrameworkInfoReply.version:type_name -> o2control.Version @@ -4992,98 +5037,102 @@ var file_protos_o2control_proto_depIdxs = []int32{ 67, // 5: o2control.EnvironmentInfo.userVars:type_name -> o2control.EnvironmentInfo.UserVarsEntry 68, // 6: o2control.EnvironmentInfo.integratedServicesData:type_name -> o2control.EnvironmentInfo.IntegratedServicesDataEntry 69, // 7: o2control.NewEnvironmentRequest.vars:type_name -> o2control.NewEnvironmentRequest.VarsEntry - 12, // 8: o2control.NewEnvironmentReply.environment:type_name -> o2control.EnvironmentInfo - 70, // 9: o2control.NewAutoEnvironmentRequest.vars:type_name -> o2control.NewAutoEnvironmentRequest.VarsEntry - 12, // 10: o2control.GetEnvironmentReply.environment:type_name -> o2control.EnvironmentInfo - 44, // 11: o2control.GetEnvironmentReply.workflow:type_name -> o2control.RoleInfo - 0, // 12: o2control.ControlEnvironmentRequest.type:type_name -> o2control.ControlEnvironmentRequest.Optype - 22, // 13: o2control.ModifyEnvironmentRequest.operations:type_name -> o2control.EnvironmentOperation - 1, // 14: o2control.EnvironmentOperation.type:type_name -> o2control.EnvironmentOperation.Optype - 22, // 15: o2control.ModifyEnvironmentReply.failedOperations:type_name -> o2control.EnvironmentOperation - 42, // 16: o2control.DestroyEnvironmentReply.cleanupTasksReply:type_name -> o2control.CleanupTasksReply - 71, // 17: o2control.SetEnvironmentPropertiesRequest.properties:type_name -> o2control.SetEnvironmentPropertiesRequest.PropertiesEntry - 72, // 18: o2control.GetEnvironmentPropertiesReply.properties:type_name -> o2control.GetEnvironmentPropertiesReply.PropertiesEntry - 33, // 19: o2control.ShortTaskInfo.deploymentInfo:type_name -> o2control.TaskDeploymentInfo - 32, // 20: o2control.GetTasksReply.tasks:type_name -> o2control.ShortTaskInfo - 40, // 21: o2control.GetTaskReply.task:type_name -> o2control.TaskInfo - 32, // 22: o2control.TaskInfo.shortInfo:type_name -> o2control.ShortTaskInfo - 39, // 23: o2control.TaskInfo.inboundChannels:type_name -> o2control.ChannelInfo - 39, // 24: o2control.TaskInfo.outboundChannels:type_name -> o2control.ChannelInfo - 38, // 25: o2control.TaskInfo.commandInfo:type_name -> o2control.CommandInfo - 73, // 26: o2control.TaskInfo.properties:type_name -> o2control.TaskInfo.PropertiesEntry - 32, // 27: o2control.CleanupTasksReply.killedTasks:type_name -> o2control.ShortTaskInfo - 32, // 28: o2control.CleanupTasksReply.runningTasks:type_name -> o2control.ShortTaskInfo - 44, // 29: o2control.RoleInfo.roles:type_name -> o2control.RoleInfo - 74, // 30: o2control.RoleInfo.defaults:type_name -> o2control.RoleInfo.DefaultsEntry - 75, // 31: o2control.RoleInfo.vars:type_name -> o2control.RoleInfo.VarsEntry - 76, // 32: o2control.RoleInfo.userVars:type_name -> o2control.RoleInfo.UserVarsEntry - 77, // 33: o2control.RoleInfo.consolidatedStack:type_name -> o2control.RoleInfo.ConsolidatedStackEntry - 44, // 34: o2control.GetRolesReply.roles:type_name -> o2control.RoleInfo - 3, // 35: o2control.VarSpecMessage.type:type_name -> o2control.VarSpecMessage.Type - 2, // 36: o2control.VarSpecMessage.widget:type_name -> o2control.VarSpecMessage.UiWidget - 78, // 37: o2control.WorkflowTemplateInfo.varSpecMap:type_name -> o2control.WorkflowTemplateInfo.VarSpecMapEntry - 48, // 38: o2control.GetWorkflowTemplatesReply.workflowTemplates:type_name -> o2control.WorkflowTemplateInfo - 51, // 39: o2control.ListReposReply.repos:type_name -> o2control.RepoInfo - 79, // 40: o2control.ListIntegratedServicesReply.services:type_name -> o2control.ListIntegratedServicesReply.ServicesEntry - 47, // 41: o2control.WorkflowTemplateInfo.VarSpecMapEntry.value:type_name -> o2control.VarSpecMessage - 64, // 42: o2control.ListIntegratedServicesReply.ServicesEntry.value:type_name -> o2control.IntegratedServiceInfo - 5, // 43: o2control.Control.GetFrameworkInfo:input_type -> o2control.GetFrameworkInfoRequest - 10, // 44: o2control.Control.GetEnvironments:input_type -> o2control.GetEnvironmentsRequest - 15, // 45: o2control.Control.NewAutoEnvironment:input_type -> o2control.NewAutoEnvironmentRequest - 13, // 46: o2control.Control.NewEnvironment:input_type -> o2control.NewEnvironmentRequest - 17, // 47: o2control.Control.GetEnvironment:input_type -> o2control.GetEnvironmentRequest - 19, // 48: o2control.Control.ControlEnvironment:input_type -> o2control.ControlEnvironmentRequest - 24, // 49: o2control.Control.DestroyEnvironment:input_type -> o2control.DestroyEnvironmentRequest - 62, // 50: o2control.Control.GetActiveDetectors:input_type -> o2control.Empty - 62, // 51: o2control.Control.GetAvailableDetectors:input_type -> o2control.Empty - 13, // 52: o2control.Control.NewEnvironmentAsync:input_type -> o2control.NewEnvironmentRequest - 34, // 53: o2control.Control.GetTasks:input_type -> o2control.GetTasksRequest - 36, // 54: o2control.Control.GetTask:input_type -> o2control.GetTaskRequest - 41, // 55: o2control.Control.CleanupTasks:input_type -> o2control.CleanupTasksRequest - 43, // 56: o2control.Control.GetRoles:input_type -> o2control.GetRolesRequest - 46, // 57: o2control.Control.GetWorkflowTemplates:input_type -> o2control.GetWorkflowTemplatesRequest - 50, // 58: o2control.Control.ListRepos:input_type -> o2control.ListReposRequest - 53, // 59: o2control.Control.AddRepo:input_type -> o2control.AddRepoRequest - 55, // 60: o2control.Control.RemoveRepo:input_type -> o2control.RemoveRepoRequest - 57, // 61: o2control.Control.RefreshRepos:input_type -> o2control.RefreshReposRequest - 58, // 62: o2control.Control.SetDefaultRepo:input_type -> o2control.SetDefaultRepoRequest - 59, // 63: o2control.Control.SetGlobalDefaultRevision:input_type -> o2control.SetGlobalDefaultRevisionRequest - 60, // 64: o2control.Control.SetRepoDefaultRevision:input_type -> o2control.SetRepoDefaultRevisionRequest - 4, // 65: o2control.Control.Subscribe:input_type -> o2control.SubscribeRequest - 62, // 66: o2control.Control.GetIntegratedServices:input_type -> o2control.Empty - 8, // 67: o2control.Control.Teardown:input_type -> o2control.TeardownRequest - 21, // 68: o2control.Control.ModifyEnvironment:input_type -> o2control.ModifyEnvironmentRequest - 7, // 69: o2control.Control.GetFrameworkInfo:output_type -> o2control.GetFrameworkInfoReply - 11, // 70: o2control.Control.GetEnvironments:output_type -> o2control.GetEnvironmentsReply - 16, // 71: o2control.Control.NewAutoEnvironment:output_type -> o2control.NewAutoEnvironmentReply - 14, // 72: o2control.Control.NewEnvironment:output_type -> o2control.NewEnvironmentReply - 18, // 73: o2control.Control.GetEnvironment:output_type -> o2control.GetEnvironmentReply - 20, // 74: o2control.Control.ControlEnvironment:output_type -> o2control.ControlEnvironmentReply - 25, // 75: o2control.Control.DestroyEnvironment:output_type -> o2control.DestroyEnvironmentReply - 26, // 76: o2control.Control.GetActiveDetectors:output_type -> o2control.GetActiveDetectorsReply - 27, // 77: o2control.Control.GetAvailableDetectors:output_type -> o2control.GetAvailableDetectorsReply - 14, // 78: o2control.Control.NewEnvironmentAsync:output_type -> o2control.NewEnvironmentReply - 35, // 79: o2control.Control.GetTasks:output_type -> o2control.GetTasksReply - 37, // 80: o2control.Control.GetTask:output_type -> o2control.GetTaskReply - 42, // 81: o2control.Control.CleanupTasks:output_type -> o2control.CleanupTasksReply - 45, // 82: o2control.Control.GetRoles:output_type -> o2control.GetRolesReply - 49, // 83: o2control.Control.GetWorkflowTemplates:output_type -> o2control.GetWorkflowTemplatesReply - 52, // 84: o2control.Control.ListRepos:output_type -> o2control.ListReposReply - 54, // 85: o2control.Control.AddRepo:output_type -> o2control.AddRepoReply - 56, // 86: o2control.Control.RemoveRepo:output_type -> o2control.RemoveRepoReply - 62, // 87: o2control.Control.RefreshRepos:output_type -> o2control.Empty - 62, // 88: o2control.Control.SetDefaultRepo:output_type -> o2control.Empty - 62, // 89: o2control.Control.SetGlobalDefaultRevision:output_type -> o2control.Empty - 61, // 90: o2control.Control.SetRepoDefaultRevision:output_type -> o2control.SetRepoDefaultRevisionReply - 80, // 91: o2control.Control.Subscribe:output_type -> events.Event - 63, // 92: o2control.Control.GetIntegratedServices:output_type -> o2control.ListIntegratedServicesReply - 9, // 93: o2control.Control.Teardown:output_type -> o2control.TeardownReply - 23, // 94: o2control.Control.ModifyEnvironment:output_type -> o2control.ModifyEnvironmentReply - 69, // [69:95] is the sub-list for method output_type - 43, // [43:69] is the sub-list for method input_type - 43, // [43:43] is the sub-list for extension type_name - 43, // [43:43] is the sub-list for extension extendee - 0, // [0:43] is the sub-list for field type_name + 80, // 8: o2control.NewEnvironmentRequest.requestUser:type_name -> common.User + 12, // 9: o2control.NewEnvironmentReply.environment:type_name -> o2control.EnvironmentInfo + 70, // 10: o2control.NewAutoEnvironmentRequest.vars:type_name -> o2control.NewAutoEnvironmentRequest.VarsEntry + 80, // 11: o2control.NewAutoEnvironmentRequest.requestUser:type_name -> common.User + 12, // 12: o2control.GetEnvironmentReply.environment:type_name -> o2control.EnvironmentInfo + 44, // 13: o2control.GetEnvironmentReply.workflow:type_name -> o2control.RoleInfo + 0, // 14: o2control.ControlEnvironmentRequest.type:type_name -> o2control.ControlEnvironmentRequest.Optype + 80, // 15: o2control.ControlEnvironmentRequest.requestUser:type_name -> common.User + 22, // 16: o2control.ModifyEnvironmentRequest.operations:type_name -> o2control.EnvironmentOperation + 1, // 17: o2control.EnvironmentOperation.type:type_name -> o2control.EnvironmentOperation.Optype + 22, // 18: o2control.ModifyEnvironmentReply.failedOperations:type_name -> o2control.EnvironmentOperation + 80, // 19: o2control.DestroyEnvironmentRequest.requestUser:type_name -> common.User + 42, // 20: o2control.DestroyEnvironmentReply.cleanupTasksReply:type_name -> o2control.CleanupTasksReply + 71, // 21: o2control.SetEnvironmentPropertiesRequest.properties:type_name -> o2control.SetEnvironmentPropertiesRequest.PropertiesEntry + 72, // 22: o2control.GetEnvironmentPropertiesReply.properties:type_name -> o2control.GetEnvironmentPropertiesReply.PropertiesEntry + 33, // 23: o2control.ShortTaskInfo.deploymentInfo:type_name -> o2control.TaskDeploymentInfo + 32, // 24: o2control.GetTasksReply.tasks:type_name -> o2control.ShortTaskInfo + 40, // 25: o2control.GetTaskReply.task:type_name -> o2control.TaskInfo + 32, // 26: o2control.TaskInfo.shortInfo:type_name -> o2control.ShortTaskInfo + 39, // 27: o2control.TaskInfo.inboundChannels:type_name -> o2control.ChannelInfo + 39, // 28: o2control.TaskInfo.outboundChannels:type_name -> o2control.ChannelInfo + 38, // 29: o2control.TaskInfo.commandInfo:type_name -> o2control.CommandInfo + 73, // 30: o2control.TaskInfo.properties:type_name -> o2control.TaskInfo.PropertiesEntry + 32, // 31: o2control.CleanupTasksReply.killedTasks:type_name -> o2control.ShortTaskInfo + 32, // 32: o2control.CleanupTasksReply.runningTasks:type_name -> o2control.ShortTaskInfo + 44, // 33: o2control.RoleInfo.roles:type_name -> o2control.RoleInfo + 74, // 34: o2control.RoleInfo.defaults:type_name -> o2control.RoleInfo.DefaultsEntry + 75, // 35: o2control.RoleInfo.vars:type_name -> o2control.RoleInfo.VarsEntry + 76, // 36: o2control.RoleInfo.userVars:type_name -> o2control.RoleInfo.UserVarsEntry + 77, // 37: o2control.RoleInfo.consolidatedStack:type_name -> o2control.RoleInfo.ConsolidatedStackEntry + 44, // 38: o2control.GetRolesReply.roles:type_name -> o2control.RoleInfo + 3, // 39: o2control.VarSpecMessage.type:type_name -> o2control.VarSpecMessage.Type + 2, // 40: o2control.VarSpecMessage.widget:type_name -> o2control.VarSpecMessage.UiWidget + 78, // 41: o2control.WorkflowTemplateInfo.varSpecMap:type_name -> o2control.WorkflowTemplateInfo.VarSpecMapEntry + 48, // 42: o2control.GetWorkflowTemplatesReply.workflowTemplates:type_name -> o2control.WorkflowTemplateInfo + 51, // 43: o2control.ListReposReply.repos:type_name -> o2control.RepoInfo + 79, // 44: o2control.ListIntegratedServicesReply.services:type_name -> o2control.ListIntegratedServicesReply.ServicesEntry + 47, // 45: o2control.WorkflowTemplateInfo.VarSpecMapEntry.value:type_name -> o2control.VarSpecMessage + 64, // 46: o2control.ListIntegratedServicesReply.ServicesEntry.value:type_name -> o2control.IntegratedServiceInfo + 5, // 47: o2control.Control.GetFrameworkInfo:input_type -> o2control.GetFrameworkInfoRequest + 10, // 48: o2control.Control.GetEnvironments:input_type -> o2control.GetEnvironmentsRequest + 15, // 49: o2control.Control.NewAutoEnvironment:input_type -> o2control.NewAutoEnvironmentRequest + 13, // 50: o2control.Control.NewEnvironment:input_type -> o2control.NewEnvironmentRequest + 17, // 51: o2control.Control.GetEnvironment:input_type -> o2control.GetEnvironmentRequest + 19, // 52: o2control.Control.ControlEnvironment:input_type -> o2control.ControlEnvironmentRequest + 24, // 53: o2control.Control.DestroyEnvironment:input_type -> o2control.DestroyEnvironmentRequest + 62, // 54: o2control.Control.GetActiveDetectors:input_type -> o2control.Empty + 62, // 55: o2control.Control.GetAvailableDetectors:input_type -> o2control.Empty + 13, // 56: o2control.Control.NewEnvironmentAsync:input_type -> o2control.NewEnvironmentRequest + 34, // 57: o2control.Control.GetTasks:input_type -> o2control.GetTasksRequest + 36, // 58: o2control.Control.GetTask:input_type -> o2control.GetTaskRequest + 41, // 59: o2control.Control.CleanupTasks:input_type -> o2control.CleanupTasksRequest + 43, // 60: o2control.Control.GetRoles:input_type -> o2control.GetRolesRequest + 46, // 61: o2control.Control.GetWorkflowTemplates:input_type -> o2control.GetWorkflowTemplatesRequest + 50, // 62: o2control.Control.ListRepos:input_type -> o2control.ListReposRequest + 53, // 63: o2control.Control.AddRepo:input_type -> o2control.AddRepoRequest + 55, // 64: o2control.Control.RemoveRepo:input_type -> o2control.RemoveRepoRequest + 57, // 65: o2control.Control.RefreshRepos:input_type -> o2control.RefreshReposRequest + 58, // 66: o2control.Control.SetDefaultRepo:input_type -> o2control.SetDefaultRepoRequest + 59, // 67: o2control.Control.SetGlobalDefaultRevision:input_type -> o2control.SetGlobalDefaultRevisionRequest + 60, // 68: o2control.Control.SetRepoDefaultRevision:input_type -> o2control.SetRepoDefaultRevisionRequest + 4, // 69: o2control.Control.Subscribe:input_type -> o2control.SubscribeRequest + 62, // 70: o2control.Control.GetIntegratedServices:input_type -> o2control.Empty + 8, // 71: o2control.Control.Teardown:input_type -> o2control.TeardownRequest + 21, // 72: o2control.Control.ModifyEnvironment:input_type -> o2control.ModifyEnvironmentRequest + 7, // 73: o2control.Control.GetFrameworkInfo:output_type -> o2control.GetFrameworkInfoReply + 11, // 74: o2control.Control.GetEnvironments:output_type -> o2control.GetEnvironmentsReply + 16, // 75: o2control.Control.NewAutoEnvironment:output_type -> o2control.NewAutoEnvironmentReply + 14, // 76: o2control.Control.NewEnvironment:output_type -> o2control.NewEnvironmentReply + 18, // 77: o2control.Control.GetEnvironment:output_type -> o2control.GetEnvironmentReply + 20, // 78: o2control.Control.ControlEnvironment:output_type -> o2control.ControlEnvironmentReply + 25, // 79: o2control.Control.DestroyEnvironment:output_type -> o2control.DestroyEnvironmentReply + 26, // 80: o2control.Control.GetActiveDetectors:output_type -> o2control.GetActiveDetectorsReply + 27, // 81: o2control.Control.GetAvailableDetectors:output_type -> o2control.GetAvailableDetectorsReply + 14, // 82: o2control.Control.NewEnvironmentAsync:output_type -> o2control.NewEnvironmentReply + 35, // 83: o2control.Control.GetTasks:output_type -> o2control.GetTasksReply + 37, // 84: o2control.Control.GetTask:output_type -> o2control.GetTaskReply + 42, // 85: o2control.Control.CleanupTasks:output_type -> o2control.CleanupTasksReply + 45, // 86: o2control.Control.GetRoles:output_type -> o2control.GetRolesReply + 49, // 87: o2control.Control.GetWorkflowTemplates:output_type -> o2control.GetWorkflowTemplatesReply + 52, // 88: o2control.Control.ListRepos:output_type -> o2control.ListReposReply + 54, // 89: o2control.Control.AddRepo:output_type -> o2control.AddRepoReply + 56, // 90: o2control.Control.RemoveRepo:output_type -> o2control.RemoveRepoReply + 62, // 91: o2control.Control.RefreshRepos:output_type -> o2control.Empty + 62, // 92: o2control.Control.SetDefaultRepo:output_type -> o2control.Empty + 62, // 93: o2control.Control.SetGlobalDefaultRevision:output_type -> o2control.Empty + 61, // 94: o2control.Control.SetRepoDefaultRevision:output_type -> o2control.SetRepoDefaultRevisionReply + 81, // 95: o2control.Control.Subscribe:output_type -> events.Event + 63, // 96: o2control.Control.GetIntegratedServices:output_type -> o2control.ListIntegratedServicesReply + 9, // 97: o2control.Control.Teardown:output_type -> o2control.TeardownReply + 23, // 98: o2control.Control.ModifyEnvironment:output_type -> o2control.ModifyEnvironmentReply + 73, // [73:99] is the sub-list for method output_type + 47, // [47:73] is the sub-list for method input_type + 47, // [47:47] is the sub-list for extension type_name + 47, // [47:47] is the sub-list for extension extendee + 0, // [0:47] is the sub-list for field type_name } func init() { file_protos_o2control_proto_init() } diff --git a/common/doc.go b/common/doc.go index d1d6f80b..1e46b632 100644 --- a/common/doc.go +++ b/common/doc.go @@ -27,3 +27,4 @@ package common //go:generate protoc -I=./ --go_out=. --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go-grpc_out=require_unimplemented_servers=false:. protos/events.proto +//go:generate protoc -I=./ --go_out=. --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go-grpc_out=require_unimplemented_servers=false:. protos/common.proto diff --git a/common/protos/common.pb.go b/common/protos/common.pb.go new file mode 100644 index 00000000..eccc0da7 --- /dev/null +++ b/common/protos/common.pb.go @@ -0,0 +1,193 @@ +// +// === This file is part of ALICE O² === +// +// Copyright 2024 CERN and copyright holders of ALICE O². +// Author: Teo Mrnjavac +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// In applying this license CERN does not waive the privileges and +// immunities granted to it by virtue of its status as an +// Intergovernmental Organization or submit itself to any jurisdiction. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.25.3 +// source: protos/common.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The unique CERN identifier of this user. + ExternalId int32 `protobuf:"varint,1,opt,name=externalId,proto3" json:"externalId,omitempty"` + // The unique identifier of this entity. + Id *int32 `protobuf:"varint,2,opt,name=id,proto3,oneof" json:"id,omitempty"` + // Name of the user. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *User) Reset() { + *x = User{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_protos_common_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_protos_common_proto_rawDescGZIP(), []int{0} +} + +func (x *User) GetExternalId() int32 { + if x != nil { + return x.ExternalId + } + return 0 +} + +func (x *User) GetId() int32 { + if x != nil && x.Id != nil { + return *x.Id + } + return 0 +} + +func (x *User) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +var File_protos_common_proto protoreflect.FileDescriptor + +var file_protos_common_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0x56, 0x0a, + 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x05, + 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x42, 0x53, 0x0a, 0x1f, 0x63, 0x68, 0x2e, 0x63, 0x65, 0x72, 0x6e, + 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x6f, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x6c, 0x69, 0x63, 0x65, 0x4f, 0x32, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x2f, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_protos_common_proto_rawDescOnce sync.Once + file_protos_common_proto_rawDescData = file_protos_common_proto_rawDesc +) + +func file_protos_common_proto_rawDescGZIP() []byte { + file_protos_common_proto_rawDescOnce.Do(func() { + file_protos_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_protos_common_proto_rawDescData) + }) + return file_protos_common_proto_rawDescData +} + +var file_protos_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_protos_common_proto_goTypes = []interface{}{ + (*User)(nil), // 0: common.User +} +var file_protos_common_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_protos_common_proto_init() } +func file_protos_common_proto_init() { + if File_protos_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_protos_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*User); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_protos_common_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_protos_common_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_protos_common_proto_goTypes, + DependencyIndexes: file_protos_common_proto_depIdxs, + MessageInfos: file_protos_common_proto_msgTypes, + }.Build() + File_protos_common_proto = out.File + file_protos_common_proto_rawDesc = nil + file_protos_common_proto_goTypes = nil + file_protos_common_proto_depIdxs = nil +} diff --git a/common/protos/common.proto b/common/protos/common.proto new file mode 100644 index 00000000..45e2fd99 --- /dev/null +++ b/common/protos/common.proto @@ -0,0 +1,41 @@ +/* + * === This file is part of ALICE O² === + * + * Copyright 2024 CERN and copyright holders of ALICE O². + * Author: Teo Mrnjavac + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * In applying this license CERN does not waive the privileges and + * immunities granted to it by virtue of its status as an + * Intergovernmental Organization or submit itself to any jurisdiction. + */ + + +syntax = "proto3"; + +package common; +option java_package = "ch.cern.alice.o2.control.common"; +option go_package = "github.com/AliceO2Group/Control/common/protos;pb"; + +//////////////// Common types /////////////// + +message User { + // The unique CERN identifier of this user. + int32 externalId = 1; + // The unique identifier of this entity. + optional int32 id = 2; + // Name of the user. + string name = 3; +} diff --git a/common/protos/events.pb.go b/common/protos/events.pb.go index 0e416d0c..2d7f2eb2 100644 --- a/common/protos/events.pb.go +++ b/common/protos/events.pb.go @@ -255,6 +255,7 @@ type Ev_EnvironmentEvent struct { TransitionStep string `protobuf:"bytes,7,opt,name=transitionStep,proto3" json:"transitionStep,omitempty"` TransitionStatus OpStatus `protobuf:"varint,8,opt,name=transitionStatus,proto3,enum=events.OpStatus" json:"transitionStatus,omitempty"` Vars map[string]string `protobuf:"bytes,9,rep,name=vars,proto3" json:"vars,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // consolidated environment variables at the root role of the environment + LastRequestUser *User `protobuf:"bytes,10,opt,name=lastRequestUser,proto3" json:"lastRequestUser,omitempty"` } func (x *Ev_EnvironmentEvent) Reset() { @@ -352,6 +353,13 @@ func (x *Ev_EnvironmentEvent) GetVars() map[string]string { return nil } +func (x *Ev_EnvironmentEvent) GetLastRequestUser() *User { + if x != nil { + return x.LastRequestUser + } + return nil +} + type Traits struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -831,6 +839,7 @@ type Ev_RunEvent struct { Transition string `protobuf:"bytes,5,opt,name=transition,proto3" json:"transition,omitempty"` TransitionStatus OpStatus `protobuf:"varint,6,opt,name=transitionStatus,proto3,enum=events.OpStatus" json:"transitionStatus,omitempty"` Vars map[string]string `protobuf:"bytes,7,rep,name=vars,proto3" json:"vars,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + LastRequestUser *User `protobuf:"bytes,8,opt,name=lastRequestUser,proto3" json:"lastRequestUser,omitempty"` } func (x *Ev_RunEvent) Reset() { @@ -914,6 +923,13 @@ func (x *Ev_RunEvent) GetVars() map[string]string { return nil } +func (x *Ev_RunEvent) GetLastRequestUser() *User { + if x != nil { + return x.LastRequestUser + } + return nil +} + type Event struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1105,190 +1121,198 @@ var File_protos_events_proto protoreflect.FileDescriptor var file_protos_events_proto_rawDesc = []byte{ 0x0a, 0x13, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x1d, 0x0a, - 0x1b, 0x45, 0x76, 0x5f, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x4d, 0x65, - 0x73, 0x6f, 0x73, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x22, 0x3a, 0x0a, 0x16, - 0x45, 0x76, 0x5f, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x43, 0x6f, 0x72, - 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, - 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x72, 0x61, - 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x22, 0x59, 0x0a, 0x1b, 0x45, 0x76, 0x5f, 0x4d, - 0x65, 0x74, 0x61, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, - 0x72, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x72, 0x61, 0x6d, 0x65, - 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x72, - 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x22, 0x99, 0x03, 0x0a, 0x13, 0x45, 0x76, 0x5f, 0x45, 0x6e, 0x76, 0x69, 0x72, - 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x65, - 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, - 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x75, 0x6e, 0x4e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x75, 0x6e, 0x4e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x12, 0x3c, 0x0a, - 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x2e, 0x4f, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x39, 0x0a, 0x04, 0x76, - 0x61, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, - 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x04, 0x76, 0x61, 0x72, 0x73, 0x1a, 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0x6e, 0x0a, 0x06, 0x54, 0x72, 0x61, 0x69, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x72, 0x69, - 0x67, 0x67, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x72, 0x69, 0x67, - 0x67, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x61, 0x77, 0x61, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x22, - 0x84, 0x02, 0x0a, 0x0c, 0x45, 0x76, 0x5f, 0x54, 0x61, 0x73, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, - 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, - 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, - 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, - 0x61, 0x69, 0x74, 0x73, 0x52, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x12, 0x24, 0x0a, 0x0d, - 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, - 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0xfc, 0x01, 0x0a, 0x0c, 0x45, 0x76, 0x5f, 0x43, 0x61, - 0x6c, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x12, 0x30, 0x0a, 0x0a, 0x63, - 0x61, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x10, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4f, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x0a, 0x63, 0x61, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, - 0x06, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, - 0x65, 0x74, 0x75, 0x72, 0x6e, 0x12, 0x26, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, - 0x72, 0x61, 0x69, 0x74, 0x73, 0x52, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x12, 0x16, 0x0a, - 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x65, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x13, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x1d, 0x0a, 0x1b, 0x45, 0x76, 0x5f, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x5f, 0x4d, 0x65, 0x73, 0x6f, 0x73, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, + 0x74, 0x22, 0x3a, 0x0a, 0x16, 0x45, 0x76, 0x5f, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x5f, 0x43, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x66, + 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x22, 0x59, 0x0a, + 0x1b, 0x45, 0x76, 0x5f, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x46, 0x72, + 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, + 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xd1, 0x03, 0x0a, 0x13, 0x45, 0x76, 0x5f, + 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, + 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x72, 0x75, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x09, 0x72, 0x75, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0e, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, + 0x65, 0x70, 0x12, 0x3c, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4f, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x10, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x39, 0x0a, 0x04, 0x76, 0x61, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x45, 0x6e, 0x76, 0x69, 0x72, + 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x56, 0x61, 0x72, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x76, 0x61, 0x72, 0x73, 0x12, 0x36, 0x0a, 0x0f, 0x6c, + 0x61, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x1a, 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x6e, 0x0a, 0x06, + 0x54, 0x72, 0x61, 0x69, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, + 0x12, 0x14, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x61, 0x77, 0x61, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x22, 0x84, 0x02, 0x0a, + 0x0c, 0x45, 0x76, 0x5f, 0x54, 0x61, 0x73, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x26, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x74, + 0x73, 0x52, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, 0x76, + 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, + 0x61, 0x74, 0x68, 0x22, 0xfc, 0x01, 0x0a, 0x0c, 0x45, 0x76, 0x5f, 0x43, 0x61, 0x6c, 0x6c, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x12, 0x30, 0x0a, 0x0a, 0x63, 0x61, 0x6c, 0x6c, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4f, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0a, + 0x63, 0x61, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, + 0x74, 0x75, 0x72, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x74, 0x75, + 0x72, 0x6e, 0x12, 0x26, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x69, + 0x74, 0x73, 0x52, 0x06, 0x74, 0x72, 0x61, 0x69, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, 0x76, 0x69, + 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, + 0x74, 0x68, 0x22, 0x92, 0x01, 0x0a, 0x0c, 0x45, 0x76, 0x5f, 0x52, 0x6f, 0x6c, 0x65, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x50, 0x61, 0x74, + 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x50, 0x61, 0x74, + 0x68, 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, + 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, + 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0xd1, 0x02, 0x0a, 0x19, 0x45, 0x76, 0x5f, 0x49, + 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, + 0x24, 0x0a, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, + 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4f, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, + 0x65, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x12, 0x42, 0x0a, 0x13, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4f, 0x70, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x13, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x53, 0x74, 0x65, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x92, 0x01, 0x0a, 0x0c, 0x45, 0x76, 0x5f, 0x52, 0x6f, 0x6c, - 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x65, - 0x50, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, - 0x50, 0x61, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, - 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, - 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0xd1, 0x02, 0x0a, 0x19, 0x45, - 0x76, 0x5f, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x0f, 0x6f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x10, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4f, 0x70, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x74, 0x65, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x12, 0x42, 0x0a, 0x13, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x2e, 0x4f, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x13, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, - 0x0a, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, - 0x6e, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xc7, - 0x02, 0x0a, 0x0b, 0x45, 0x76, 0x5f, 0x52, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x24, - 0x0a, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, - 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x75, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x75, 0x6e, 0x4e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1e, - 0x0a, 0x0a, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, - 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x73, 0x2e, 0x4f, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x31, 0x0a, 0x04, - 0x76, 0x61, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x52, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, - 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x76, 0x61, 0x72, 0x73, 0x1a, - 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xab, 0x05, 0x0a, 0x05, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x49, 0x0a, 0x10, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, - 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x10, 0x65, 0x6e, 0x76, 0x69, 0x72, - 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x09, 0x74, - 0x61, 0x73, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x54, 0x61, 0x73, 0x6b, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, - 0x5f, 0x52, 0x6f, 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x09, 0x72, 0x6f, - 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x09, 0x63, 0x61, 0x6c, 0x6c, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x43, 0x61, 0x6c, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x48, 0x00, 0x52, 0x09, 0x63, 0x61, 0x6c, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x5b, 0x0a, - 0x16, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x48, 0x00, 0x52, 0x16, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x08, 0x72, 0x75, - 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x52, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x48, 0x00, 0x52, 0x08, 0x72, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x4d, 0x0a, - 0x0e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, - 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, - 0x76, 0x5f, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x46, 0x72, 0x61, 0x6d, - 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x66, 0x72, - 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x57, 0x0a, 0x13, - 0x6d, 0x65, 0x73, 0x6f, 0x73, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x5f, - 0x4d, 0x65, 0x73, 0x6f, 0x73, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x48, 0x00, - 0x52, 0x13, 0x6d, 0x65, 0x73, 0x6f, 0x73, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0e, 0x63, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x67, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x5f, 0x43, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x48, 0x00, 0x52, - 0x0e, 0x63, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, - 0x09, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x0b, - 0x4a, 0x04, 0x08, 0x11, 0x10, 0x65, 0x2a, 0x5d, 0x0a, 0x08, 0x4f, 0x70, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x55, 0x4c, 0x4c, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, - 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x4e, 0x47, - 0x4f, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x4f, 0x4e, 0x45, 0x5f, 0x4f, - 0x4b, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x4f, 0x4e, 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, - 0x52, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x4f, 0x4e, 0x45, 0x5f, 0x54, 0x49, 0x4d, 0x45, - 0x4f, 0x55, 0x54, 0x10, 0x05, 0x42, 0x53, 0x0a, 0x1f, 0x63, 0x68, 0x2e, 0x63, 0x65, 0x72, 0x6e, - 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x6f, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x6c, 0x69, 0x63, 0x65, 0x4f, 0x32, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x2f, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xff, 0x02, 0x0a, 0x0b, + 0x45, 0x76, 0x5f, 0x52, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x65, + 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, + 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x75, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x75, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x10, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x4f, + 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x31, 0x0a, 0x04, 0x76, 0x61, 0x72, + 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x2e, 0x45, 0x76, 0x5f, 0x52, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x56, 0x61, 0x72, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x76, 0x61, 0x72, 0x73, 0x12, 0x36, 0x0a, 0x0f, + 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x1a, 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xab, 0x05, + 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x49, 0x0a, 0x10, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, + 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x45, 0x6e, 0x76, 0x69, + 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x10, + 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x12, 0x34, 0x0a, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, + 0x54, 0x61, 0x73, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x09, 0x74, 0x61, 0x73, + 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x52, 0x6f, 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, + 0x00, 0x52, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x09, + 0x63, 0x61, 0x6c, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x43, 0x61, 0x6c, 0x6c, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x09, 0x63, 0x61, 0x6c, 0x6c, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x5b, 0x0a, 0x16, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x65, 0x64, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x49, + 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x16, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, + 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, + 0x31, 0x0a, 0x08, 0x72, 0x75, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x52, 0x75, + 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x08, 0x72, 0x75, 0x6e, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x4d, 0x0a, 0x0e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x18, 0x65, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x5f, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, + 0x00, 0x52, 0x0e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x12, 0x57, 0x0a, 0x13, 0x6d, 0x65, 0x73, 0x6f, 0x73, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, + 0x65, 0x61, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x66, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x4d, 0x65, 0x74, 0x61, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x4d, 0x65, 0x73, 0x6f, 0x73, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, + 0x65, 0x61, 0x74, 0x48, 0x00, 0x52, 0x13, 0x6d, 0x65, 0x73, 0x6f, 0x73, 0x48, 0x65, 0x61, 0x72, + 0x74, 0x62, 0x65, 0x61, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0e, 0x63, 0x6f, + 0x72, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x67, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x45, 0x76, 0x5f, 0x4d, + 0x65, 0x74, 0x61, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x43, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x4a, + 0x04, 0x08, 0x02, 0x10, 0x0b, 0x4a, 0x04, 0x08, 0x11, 0x10, 0x65, 0x2a, 0x5d, 0x0a, 0x08, 0x4f, + 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x55, 0x4c, 0x4c, 0x10, + 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, + 0x0a, 0x07, 0x4f, 0x4e, 0x47, 0x4f, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x44, + 0x4f, 0x4e, 0x45, 0x5f, 0x4f, 0x4b, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x4f, 0x4e, 0x45, + 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x4f, 0x4e, 0x45, + 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, 0x05, 0x42, 0x53, 0x0a, 0x1f, 0x63, 0x68, + 0x2e, 0x63, 0x65, 0x72, 0x6e, 0x2e, 0x61, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x6f, 0x32, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5a, 0x30, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x6c, 0x69, 0x63, 0x65, 0x4f, + 0x32, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x3b, 0x70, 0x62, 0x50, + 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1320,31 +1344,34 @@ var file_protos_events_proto_goTypes = []interface{}{ (*Event)(nil), // 11: events.Event nil, // 12: events.Ev_EnvironmentEvent.VarsEntry nil, // 13: events.Ev_RunEvent.VarsEntry + (*User)(nil), // 14: common.User } var file_protos_events_proto_depIdxs = []int32{ 0, // 0: events.Ev_EnvironmentEvent.transitionStatus:type_name -> events.OpStatus 12, // 1: events.Ev_EnvironmentEvent.vars:type_name -> events.Ev_EnvironmentEvent.VarsEntry - 5, // 2: events.Ev_TaskEvent.traits:type_name -> events.Traits - 0, // 3: events.Ev_CallEvent.callStatus:type_name -> events.OpStatus - 5, // 4: events.Ev_CallEvent.traits:type_name -> events.Traits - 0, // 5: events.Ev_IntegratedServiceEvent.operationStatus:type_name -> events.OpStatus - 0, // 6: events.Ev_IntegratedServiceEvent.operationStepStatus:type_name -> events.OpStatus - 0, // 7: events.Ev_RunEvent.transitionStatus:type_name -> events.OpStatus - 13, // 8: events.Ev_RunEvent.vars:type_name -> events.Ev_RunEvent.VarsEntry - 4, // 9: events.Event.environmentEvent:type_name -> events.Ev_EnvironmentEvent - 6, // 10: events.Event.taskEvent:type_name -> events.Ev_TaskEvent - 8, // 11: events.Event.roleEvent:type_name -> events.Ev_RoleEvent - 7, // 12: events.Event.callEvent:type_name -> events.Ev_CallEvent - 9, // 13: events.Event.integratedServiceEvent:type_name -> events.Ev_IntegratedServiceEvent - 10, // 14: events.Event.runEvent:type_name -> events.Ev_RunEvent - 3, // 15: events.Event.frameworkEvent:type_name -> events.Ev_MetaEvent_FrameworkEvent - 1, // 16: events.Event.mesosHeartbeatEvent:type_name -> events.Ev_MetaEvent_MesosHeartbeat - 2, // 17: events.Event.coreStartEvent:type_name -> events.Ev_MetaEvent_CoreStart - 18, // [18:18] is the sub-list for method output_type - 18, // [18:18] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name + 14, // 2: events.Ev_EnvironmentEvent.lastRequestUser:type_name -> common.User + 5, // 3: events.Ev_TaskEvent.traits:type_name -> events.Traits + 0, // 4: events.Ev_CallEvent.callStatus:type_name -> events.OpStatus + 5, // 5: events.Ev_CallEvent.traits:type_name -> events.Traits + 0, // 6: events.Ev_IntegratedServiceEvent.operationStatus:type_name -> events.OpStatus + 0, // 7: events.Ev_IntegratedServiceEvent.operationStepStatus:type_name -> events.OpStatus + 0, // 8: events.Ev_RunEvent.transitionStatus:type_name -> events.OpStatus + 13, // 9: events.Ev_RunEvent.vars:type_name -> events.Ev_RunEvent.VarsEntry + 14, // 10: events.Ev_RunEvent.lastRequestUser:type_name -> common.User + 4, // 11: events.Event.environmentEvent:type_name -> events.Ev_EnvironmentEvent + 6, // 12: events.Event.taskEvent:type_name -> events.Ev_TaskEvent + 8, // 13: events.Event.roleEvent:type_name -> events.Ev_RoleEvent + 7, // 14: events.Event.callEvent:type_name -> events.Ev_CallEvent + 9, // 15: events.Event.integratedServiceEvent:type_name -> events.Ev_IntegratedServiceEvent + 10, // 16: events.Event.runEvent:type_name -> events.Ev_RunEvent + 3, // 17: events.Event.frameworkEvent:type_name -> events.Ev_MetaEvent_FrameworkEvent + 1, // 18: events.Event.mesosHeartbeatEvent:type_name -> events.Ev_MetaEvent_MesosHeartbeat + 2, // 19: events.Event.coreStartEvent:type_name -> events.Ev_MetaEvent_CoreStart + 20, // [20:20] is the sub-list for method output_type + 20, // [20:20] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_protos_events_proto_init() } @@ -1352,6 +1379,7 @@ func file_protos_events_proto_init() { if File_protos_events_proto != nil { return } + file_protos_common_proto_init() if !protoimpl.UnsafeEnabled { file_protos_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Ev_MetaEvent_MesosHeartbeat); i { diff --git a/common/protos/events.proto b/common/protos/events.proto index 38270e8b..478d8b6e 100644 --- a/common/protos/events.proto +++ b/common/protos/events.proto @@ -28,6 +28,8 @@ package events; option java_package = "ch.cern.alice.o2.control.events"; option go_package = "github.com/AliceO2Group/Control/common/protos;pb"; +import public "protos/common.proto"; + //////////////// Common event messages /////////////// enum OpStatus { @@ -61,6 +63,7 @@ message Ev_EnvironmentEvent { string transitionStep = 7; OpStatus transitionStatus = 8; map vars = 9; // consolidated environment variables at the root role of the environment + common.User lastRequestUser = 10; } message Traits { @@ -120,6 +123,7 @@ message Ev_RunEvent { string transition = 5; OpStatus transitionStatus = 6; map vars = 7; + common.User lastRequestUser = 8; } message Event { diff --git a/core/environment/environment.go b/core/environment/environment.go index 4c186dfe..3f815893 100644 --- a/core/environment/environment.go +++ b/core/environment/environment.go @@ -28,6 +28,7 @@ package environment import ( "context" + "encoding/json" "errors" "fmt" "sort" @@ -164,12 +165,13 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, trigger := fmt.Sprintf("before_%s", e.Event) the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.GetCurrentRunNumber(), - Transition: e.Event, - TransitionStep: trigger, - Message: "transition step starting", + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.GetCurrentRunNumber(), + Transition: e.Event, + TransitionStep: trigger, + Message: "transition step starting", + LastRequestUser: env.GetLastRequestUser(), }) // If the event is START_ACTIVITY, we set up and update variables relevant to plugins early on. @@ -202,6 +204,7 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, Transition: e.Event, TransitionStatus: pb.OpStatus_STARTED, Vars: nil, + LastRequestUser: env.GetLastRequestUser(), }, runStartTime) cleanupCount := 0 @@ -242,6 +245,7 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, Transition: e.Event, TransitionStatus: pb.OpStatus_STARTED, Vars: nil, + LastRequestUser: env.GetLastRequestUser(), }, runEndTime) } else { @@ -263,6 +267,7 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, Transition: e.Event, TransitionStatus: pb.OpStatus_STARTED, Vars: nil, + LastRequestUser: env.GetLastRequestUser(), }, runEndTime) } else { @@ -295,25 +300,27 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, } the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Error: errorMsg, - Message: "transition step finished", - Transition: e.Event, - TransitionStep: trigger, + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Error: errorMsg, + Message: "transition step finished", + Transition: e.Event, + TransitionStep: trigger, + LastRequestUser: env.GetLastRequestUser(), }) }, "leave_state": func(_ context.Context, e *fsm.Event) { trigger := fmt.Sprintf("leave_%s", e.Src) the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Transition: e.Event, - TransitionStep: trigger, - Message: "transition step starting", + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Transition: e.Event, + TransitionStep: trigger, + Message: "transition step starting", + LastRequestUser: env.GetLastRequestUser(), }) // We might leave RUNNING not only through STOP_ACTIVITY. In such cases we also need a run stop time. @@ -338,13 +345,14 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, } the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Error: errorMsg, - Message: "transition step finished", - Transition: e.Event, - TransitionStep: trigger, + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Error: errorMsg, + Message: "transition step finished", + Transition: e.Event, + TransitionStep: trigger, + LastRequestUser: env.GetLastRequestUser(), }) if e.Err != nil { @@ -352,12 +360,13 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, } the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Message: "transition step starting", - Transition: e.Event, - TransitionStep: fmt.Sprintf("tasks_%s", e.Event), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Message: "transition step starting", + Transition: e.Event, + TransitionStep: fmt.Sprintf("tasks_%s", e.Event), + LastRequestUser: env.GetLastRequestUser(), }) env.handlerFunc()(e) @@ -367,13 +376,14 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, } the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: e.Dst, // exceptionally we take the destination state here instead of the current, because the tasks have transitioned - RunNumber: env.currentRunNumber, - Error: errorMsg, - Message: "transition step finished", - Transition: e.Event, - TransitionStep: fmt.Sprintf("tasks_%s", e.Event), + EnvironmentId: env.id.String(), + State: e.Dst, // exceptionally we take the destination state here instead of the current, because the tasks have transitioned + RunNumber: env.currentRunNumber, + Error: errorMsg, + Message: "transition step finished", + Transition: e.Event, + TransitionStep: fmt.Sprintf("tasks_%s", e.Event), + LastRequestUser: env.GetLastRequestUser(), }) }, @@ -381,12 +391,13 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, trigger := fmt.Sprintf("enter_%s", e.Dst) the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Transition: e.Event, - TransitionStep: trigger, - Message: "transition step starting", + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Transition: e.Event, + TransitionStep: trigger, + Message: "transition step starting", + LastRequestUser: env.GetLastRequestUser(), }) enterStateTimeMs = strconv.FormatInt(time.Now().UnixMilli(), 10) @@ -403,13 +414,14 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, } the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Error: errorMsg, - Message: "transition step finished", - Transition: e.Event, - TransitionStep: trigger, + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Error: errorMsg, + Message: "transition step finished", + Transition: e.Event, + TransitionStep: trigger, + LastRequestUser: env.GetLastRequestUser(), }) if e.Err != nil { @@ -433,12 +445,13 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, trigger := fmt.Sprintf("after_%s", e.Event) the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Transition: e.Event, - TransitionStep: trigger, - Message: "transition step starting", + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Transition: e.Event, + TransitionStep: trigger, + Message: "transition step starting", + LastRequestUser: env.GetLastRequestUser(), }) errHooks := env.handleHooks(env.Workflow(), trigger) @@ -489,6 +502,7 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, Transition: e.Event, TransitionStatus: pb.OpStatus_DONE_OK, Vars: nil, + LastRequestUser: env.GetLastRequestUser(), } if e.Err != nil { runEvent.Error = e.Err.Error() @@ -510,6 +524,7 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, Transition: e.Event, TransitionStatus: pb.OpStatus_DONE_OK, Vars: nil, + LastRequestUser: env.GetLastRequestUser(), } if e.Err != nil { runEvent.Error = e.Err.Error() @@ -540,6 +555,7 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, Transition: e.Event, TransitionStatus: pb.OpStatus_DONE_OK, Vars: nil, + LastRequestUser: env.GetLastRequestUser(), }, runEndCompletionTime) } else { @@ -554,13 +570,14 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, } // publish transition step complete event the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Error: errorMsg, - Message: "transition step finished", - Transition: e.Event, - TransitionStep: trigger, + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Error: errorMsg, + Message: "transition step finished", + Transition: e.Event, + TransitionStep: trigger, + LastRequestUser: env.GetLastRequestUser(), }) }, }, @@ -871,22 +888,24 @@ func (env *Environment) runTasksAsHooks(hooksToTrigger task.Tasks) (errorMap map func (env *Environment) TryTransition(t Transition) (err error) { the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Message: "transition starting", - Transition: t.eventName(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Message: "transition starting", + Transition: t.eventName(), + LastRequestUser: env.GetLastRequestUser(), }) err = t.check() if err != nil { the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Error: err.Error(), - Message: "transition impossible", - Transition: t.eventName(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Error: err.Error(), + Message: "transition impossible", + Transition: t.eventName(), + LastRequestUser: env.GetLastRequestUser(), }) return } @@ -894,20 +913,22 @@ func (env *Environment) TryTransition(t Transition) (err error) { if err != nil { the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Error: err.Error(), - Message: "transition error", - Transition: t.eventName(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Error: err.Error(), + Message: "transition error", + Transition: t.eventName(), + LastRequestUser: env.GetLastRequestUser(), }) } else { the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ - EnvironmentId: env.id.String(), - State: env.Sm.Current(), - RunNumber: env.currentRunNumber, - Message: "transition completed successfully", - Transition: t.eventName(), + EnvironmentId: env.id.String(), + State: env.Sm.Current(), + RunNumber: env.currentRunNumber, + Message: "transition completed successfully", + Transition: t.eventName(), + LastRequestUser: env.GetLastRequestUser(), }) } return @@ -985,6 +1006,28 @@ func (env *Environment) CurrentTransition() string { return env.currentTransition } +func (env *Environment) SetLastRequestUser(lastRequestUser *pb.User) { + if env == nil { + return + } + lastRequestUserJ, err := json.Marshal(lastRequestUser) + if err == nil { + env.UserVars.Set("last_request_user", string(lastRequestUserJ[:])) + } +} + +func (env *Environment) GetLastRequestUser() *pb.User { + if env == nil { + return nil + } + lastRequestUser := &pb.User{} + lastRequestUserJ, ok := env.UserVars.Get("last_request_user") + if ok { + _ = json.Unmarshal([]byte(lastRequestUserJ), lastRequestUser) + } + return lastRequestUser +} + func (env *Environment) IsSafeToStop() bool { tasks := env.Workflow().GetTasks() for _, t := range tasks { diff --git a/core/environment/manager.go b/core/environment/manager.go index 63440b66..0e67e4af 100644 --- a/core/environment/manager.go +++ b/core/environment/manager.go @@ -25,6 +25,7 @@ package environment import ( + "encoding/json" "errors" "fmt" "strconv" @@ -223,12 +224,19 @@ func (envs *Manager) CreateEnvironment(workflowPath string, userVars map[string] // created environment. alreadyActiveDetectors := envs.GetActiveDetectors() + lastRequestUser := &evpb.User{} + lastRequestUserJ, ok := userVars["last_request_user"] + if ok { + _ = json.Unmarshal([]byte(lastRequestUserJ), lastRequestUser) + } + the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: newId.String(), - State: "PENDING", - Transition: "CREATE", - TransitionStep: "before_CREATE", - Message: "instantiating", + EnvironmentId: newId.String(), + State: "PENDING", + Transition: "CREATE", + TransitionStep: "before_CREATE", + Message: "instantiating", + LastRequestUser: lastRequestUser, }) // userVar identifiers come in 2 forms: @@ -301,11 +309,12 @@ func (envs *Manager) CreateEnvironment(workflowPath string, userVars map[string] }).Info("creating new environment") the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: newId.String(), - State: "PENDING", - Transition: "CREATE", - TransitionStep: "before_CREATE", - Message: "running hooks", + EnvironmentId: newId.String(), + State: "PENDING", + Transition: "CREATE", + TransitionStep: "before_CREATE", + Message: "running hooks", + LastRequestUser: lastRequestUser, }) env.hookHandlerF = func(hooks task.Tasks) error { @@ -327,11 +336,12 @@ func (envs *Manager) CreateEnvironment(workflowPath string, userVars map[string] } the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: newId.String(), - State: "PENDING", - Transition: "CREATE", - TransitionStep: "CREATE", - Message: "loading workflow", + EnvironmentId: newId.String(), + State: "PENDING", + Transition: "CREATE", + TransitionStep: "CREATE", + Message: "loading workflow", + LastRequestUser: lastRequestUser, }) // We load the workflow (includes template processing) @@ -372,12 +382,13 @@ func (envs *Manager) CreateEnvironment(workflowPath string, userVars map[string] cvs, _ := env.Workflow().ConsolidatedVarStack() the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: newId.String(), - State: env.CurrentState(), - Transition: "CREATE", - TransitionStep: "after_CREATE", - Message: "workflow loaded", - Vars: cvs, // we push the full var stack of the root role in the workflow loaded event + EnvironmentId: newId.String(), + State: env.CurrentState(), + Transition: "CREATE", + TransitionStep: "after_CREATE", + Message: "workflow loaded", + Vars: cvs, // we push the full var stack of the root role in the workflow loaded event + LastRequestUser: lastRequestUser, }) log.WithField("method", "CreateEnvironment"). @@ -576,11 +587,12 @@ func (envs *Manager) TeardownEnvironment(environmentId uid.ID, force bool) error } the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: environmentId.String(), - State: env.CurrentState(), - Transition: "DESTROY", - TransitionStep: "before_DESTROY", - Message: "workflow teardown started", + EnvironmentId: environmentId.String(), + State: env.CurrentState(), + Transition: "DESTROY", + TransitionStep: "before_DESTROY", + Message: "workflow teardown started", + LastRequestUser: env.GetLastRequestUser(), }) env.Mu.Lock() @@ -588,11 +600,12 @@ func (envs *Manager) TeardownEnvironment(environmentId uid.ID, force bool) error env.Mu.Unlock() the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: environmentId.String(), - State: env.CurrentState(), - Transition: "DESTROY", - TransitionStep: "leave_" + env.CurrentState(), - Message: "workflow teardown ongoing", + EnvironmentId: environmentId.String(), + State: env.CurrentState(), + Transition: "DESTROY", + TransitionStep: "leave_" + env.CurrentState(), + Message: "workflow teardown ongoing", + LastRequestUser: env.GetLastRequestUser(), }) err = env.handleHooks(env.Workflow(), "leave_"+env.CurrentState()) @@ -672,11 +685,12 @@ func (envs *Manager) TeardownEnvironment(environmentId uid.ID, force bool) error } the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: environmentId.String(), - State: env.CurrentState(), - Transition: "DESTROY", - TransitionStep: "DESTROY", - Message: "releasing tasks", + EnvironmentId: environmentId.String(), + State: env.CurrentState(), + Transition: "DESTROY", + TransitionStep: "DESTROY", + Message: "releasing tasks", + LastRequestUser: env.GetLastRequestUser(), }) log.WithField("method", "TeardownEnvironment"). @@ -738,23 +752,25 @@ func (envs *Manager) TeardownEnvironment(environmentId uid.ID, force bool) error len(taskReleaseErrors), environmentId) the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: environmentId.String(), - State: "DONE", - Transition: "DESTROY", - TransitionStep: "after_DESTROY", - Message: "environment teardown finished with error", - Error: err.Error(), + EnvironmentId: environmentId.String(), + State: "DONE", + Transition: "DESTROY", + TransitionStep: "after_DESTROY", + Message: "environment teardown finished with error", + Error: err.Error(), + LastRequestUser: env.GetLastRequestUser(), }) return err } the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: environmentId.String(), - State: env.CurrentState(), - Transition: "DESTROY", - TransitionStep: "after_DESTROY", - Message: "running DESTROY hooks", + EnvironmentId: environmentId.String(), + State: env.CurrentState(), + Transition: "DESTROY", + TransitionStep: "after_DESTROY", + Message: "running DESTROY hooks", + LastRequestUser: env.GetLastRequestUser(), }) // we trigger all cleanup hooks, first calls, then tasks immediately after @@ -816,12 +832,13 @@ func (envs *Manager) TeardownEnvironment(environmentId uid.ID, force bool) error len(taskReleaseErrors), environmentId) the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: environmentId.String(), - State: "DONE", - Transition: "DESTROY", - TransitionStep: "after_DESTROY", - Message: "environment teardown finished with error", - Error: err.Error(), + EnvironmentId: environmentId.String(), + State: "DONE", + Transition: "DESTROY", + TransitionStep: "after_DESTROY", + Message: "environment teardown finished with error", + Error: err.Error(), + LastRequestUser: env.GetLastRequestUser(), }) return err @@ -841,11 +858,12 @@ func (envs *Manager) TeardownEnvironment(environmentId uid.ID, force bool) error Debug("envman write lock") the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: environmentId.String(), - State: "DONE", - Transition: "DESTROY", - TransitionStep: "after_DESTROY", - Message: "environment teardown complete", + EnvironmentId: environmentId.String(), + State: "DONE", + Transition: "DESTROY", + TransitionStep: "after_DESTROY", + Message: "environment teardown complete", + LastRequestUser: env.GetLastRequestUser(), }) return err diff --git a/core/protos/o2control.pb.go b/core/protos/o2control.pb.go index 8c846cff..dbd2b96e 100644 --- a/core/protos/o2control.pb.go +++ b/core/protos/o2control.pb.go @@ -998,6 +998,7 @@ type NewEnvironmentRequest struct { Vars map[string]string `protobuf:"bytes,2,rep,name=vars,proto3" json:"vars,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Public bool `protobuf:"varint,3,opt,name=public,proto3" json:"public,omitempty"` AutoTransition bool `protobuf:"varint,4,opt,name=autoTransition,proto3" json:"autoTransition,omitempty"` + RequestUser *protos.User `protobuf:"bytes,5,opt,name=requestUser,proto3" json:"requestUser,omitempty"` } func (x *NewEnvironmentRequest) Reset() { @@ -1060,6 +1061,13 @@ func (x *NewEnvironmentRequest) GetAutoTransition() bool { return false } +func (x *NewEnvironmentRequest) GetRequestUser() *protos.User { + if x != nil { + return x.RequestUser + } + return nil +} + type NewEnvironmentReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1123,6 +1131,7 @@ type NewAutoEnvironmentRequest struct { WorkflowTemplate string `protobuf:"bytes,1,opt,name=workflowTemplate,proto3" json:"workflowTemplate,omitempty"` Vars map[string]string `protobuf:"bytes,2,rep,name=vars,proto3" json:"vars,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` + RequestUser *protos.User `protobuf:"bytes,4,opt,name=requestUser,proto3" json:"requestUser,omitempty"` } func (x *NewAutoEnvironmentRequest) Reset() { @@ -1178,6 +1187,13 @@ func (x *NewAutoEnvironmentRequest) GetId() string { return "" } +func (x *NewAutoEnvironmentRequest) GetRequestUser() *protos.User { + if x != nil { + return x.RequestUser + } + return nil +} + type NewAutoEnvironmentReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1339,8 +1355,9 @@ type ControlEnvironmentRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Type ControlEnvironmentRequest_Optype `protobuf:"varint,2,opt,name=type,proto3,enum=o2control.ControlEnvironmentRequest_Optype" json:"type,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Type ControlEnvironmentRequest_Optype `protobuf:"varint,2,opt,name=type,proto3,enum=o2control.ControlEnvironmentRequest_Optype" json:"type,omitempty"` + RequestUser *protos.User `protobuf:"bytes,3,opt,name=requestUser,proto3" json:"requestUser,omitempty"` } func (x *ControlEnvironmentRequest) Reset() { @@ -1389,6 +1406,13 @@ func (x *ControlEnvironmentRequest) GetType() ControlEnvironmentRequest_Optype { return ControlEnvironmentRequest_NOOP } +func (x *ControlEnvironmentRequest) GetRequestUser() *protos.User { + if x != nil { + return x.RequestUser + } + return nil +} + type ControlEnvironmentReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1663,10 +1687,11 @@ type DestroyEnvironmentRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - KeepTasks bool `protobuf:"varint,2,opt,name=keepTasks,proto3" json:"keepTasks,omitempty"` - AllowInRunningState bool `protobuf:"varint,3,opt,name=allowInRunningState,proto3" json:"allowInRunningState,omitempty"` - Force bool `protobuf:"varint,4,opt,name=force,proto3" json:"force,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + KeepTasks bool `protobuf:"varint,2,opt,name=keepTasks,proto3" json:"keepTasks,omitempty"` + AllowInRunningState bool `protobuf:"varint,3,opt,name=allowInRunningState,proto3" json:"allowInRunningState,omitempty"` + Force bool `protobuf:"varint,4,opt,name=force,proto3" json:"force,omitempty"` + RequestUser *protos.User `protobuf:"bytes,5,opt,name=requestUser,proto3" json:"requestUser,omitempty"` } func (x *DestroyEnvironmentRequest) Reset() { @@ -1729,6 +1754,13 @@ func (x *DestroyEnvironmentRequest) GetForce() bool { return false } +func (x *DestroyEnvironmentRequest) GetRequestUser() *protos.User { + if x != nil { + return x.RequestUser + } + return nil +} + type DestroyEnvironmentReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4277,7 +4309,7 @@ var file_protos_o2control_proto_rawDesc = []byte{ 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0xfc, 0x01, 0x0a, 0x15, 0x4e, 0x65, 0x77, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, + 0xac, 0x02, 0x0a, 0x15, 0x4e, 0x65, 0x77, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, @@ -4289,7 +4321,10 @@ var file_protos_o2control_proto_rawDesc = []byte{ 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x6f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x6f, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x6b, @@ -4299,7 +4334,7 @@ var file_protos_o2control_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x22, 0xd4, 0x01, 0x0a, 0x19, + 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x22, 0x84, 0x02, 0x0a, 0x19, 0x4e, 0x65, 0x77, 0x41, 0x75, 0x74, 0x6f, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, @@ -4309,7 +4344,10 @@ var file_protos_o2control_proto_rawDesc = []byte{ 0x4e, 0x65, 0x77, 0x41, 0x75, 0x74, 0x6f, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x76, 0x61, 0x72, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x1a, 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x0b, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x0b, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x37, 0x0a, 0x09, 0x56, 0x61, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, @@ -4330,13 +4368,16 @@ var file_protos_o2control_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x22, 0xdb, 0x01, 0x0a, 0x19, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x45, 0x6e, 0x76, + 0x63, 0x22, 0x8b, 0x02, 0x0a, 0x19, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x6f, 0x32, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x2e, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x22, 0x6d, 0x0a, 0x06, 0x4f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4f, 0x50, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x49, 0x54, 0x59, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x4f, 0x50, @@ -4387,7 +4428,7 @@ var file_protos_o2control_proto_rawDesc = []byte{ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x91, 0x01, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0xc1, 0x01, 0x0a, 0x19, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6b, @@ -4397,7 +4438,10 @@ var file_protos_o2control_proto_rawDesc = []byte{ 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x49, 0x6e, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, - 0x65, 0x22, 0x65, 0x0a, 0x17, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x45, 0x6e, 0x76, 0x69, + 0x65, 0x12, 0x2e, 0x0a, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x22, 0x65, 0x0a, 0x17, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x4a, 0x0a, 0x11, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x32, 0x63, 0x6f, 0x6e, 0x74, @@ -4981,7 +5025,8 @@ var file_protos_o2control_proto_goTypes = []interface{}{ nil, // 77: o2control.RoleInfo.ConsolidatedStackEntry nil, // 78: o2control.WorkflowTemplateInfo.VarSpecMapEntry nil, // 79: o2control.ListIntegratedServicesReply.ServicesEntry - (*protos.Event)(nil), // 80: events.Event + (*protos.User)(nil), // 80: common.User + (*protos.Event)(nil), // 81: events.Event } var file_protos_o2control_proto_depIdxs = []int32{ 6, // 0: o2control.GetFrameworkInfoReply.version:type_name -> o2control.Version @@ -4992,98 +5037,102 @@ var file_protos_o2control_proto_depIdxs = []int32{ 67, // 5: o2control.EnvironmentInfo.userVars:type_name -> o2control.EnvironmentInfo.UserVarsEntry 68, // 6: o2control.EnvironmentInfo.integratedServicesData:type_name -> o2control.EnvironmentInfo.IntegratedServicesDataEntry 69, // 7: o2control.NewEnvironmentRequest.vars:type_name -> o2control.NewEnvironmentRequest.VarsEntry - 12, // 8: o2control.NewEnvironmentReply.environment:type_name -> o2control.EnvironmentInfo - 70, // 9: o2control.NewAutoEnvironmentRequest.vars:type_name -> o2control.NewAutoEnvironmentRequest.VarsEntry - 12, // 10: o2control.GetEnvironmentReply.environment:type_name -> o2control.EnvironmentInfo - 44, // 11: o2control.GetEnvironmentReply.workflow:type_name -> o2control.RoleInfo - 0, // 12: o2control.ControlEnvironmentRequest.type:type_name -> o2control.ControlEnvironmentRequest.Optype - 22, // 13: o2control.ModifyEnvironmentRequest.operations:type_name -> o2control.EnvironmentOperation - 1, // 14: o2control.EnvironmentOperation.type:type_name -> o2control.EnvironmentOperation.Optype - 22, // 15: o2control.ModifyEnvironmentReply.failedOperations:type_name -> o2control.EnvironmentOperation - 42, // 16: o2control.DestroyEnvironmentReply.cleanupTasksReply:type_name -> o2control.CleanupTasksReply - 71, // 17: o2control.SetEnvironmentPropertiesRequest.properties:type_name -> o2control.SetEnvironmentPropertiesRequest.PropertiesEntry - 72, // 18: o2control.GetEnvironmentPropertiesReply.properties:type_name -> o2control.GetEnvironmentPropertiesReply.PropertiesEntry - 33, // 19: o2control.ShortTaskInfo.deploymentInfo:type_name -> o2control.TaskDeploymentInfo - 32, // 20: o2control.GetTasksReply.tasks:type_name -> o2control.ShortTaskInfo - 40, // 21: o2control.GetTaskReply.task:type_name -> o2control.TaskInfo - 32, // 22: o2control.TaskInfo.shortInfo:type_name -> o2control.ShortTaskInfo - 39, // 23: o2control.TaskInfo.inboundChannels:type_name -> o2control.ChannelInfo - 39, // 24: o2control.TaskInfo.outboundChannels:type_name -> o2control.ChannelInfo - 38, // 25: o2control.TaskInfo.commandInfo:type_name -> o2control.CommandInfo - 73, // 26: o2control.TaskInfo.properties:type_name -> o2control.TaskInfo.PropertiesEntry - 32, // 27: o2control.CleanupTasksReply.killedTasks:type_name -> o2control.ShortTaskInfo - 32, // 28: o2control.CleanupTasksReply.runningTasks:type_name -> o2control.ShortTaskInfo - 44, // 29: o2control.RoleInfo.roles:type_name -> o2control.RoleInfo - 74, // 30: o2control.RoleInfo.defaults:type_name -> o2control.RoleInfo.DefaultsEntry - 75, // 31: o2control.RoleInfo.vars:type_name -> o2control.RoleInfo.VarsEntry - 76, // 32: o2control.RoleInfo.userVars:type_name -> o2control.RoleInfo.UserVarsEntry - 77, // 33: o2control.RoleInfo.consolidatedStack:type_name -> o2control.RoleInfo.ConsolidatedStackEntry - 44, // 34: o2control.GetRolesReply.roles:type_name -> o2control.RoleInfo - 3, // 35: o2control.VarSpecMessage.type:type_name -> o2control.VarSpecMessage.Type - 2, // 36: o2control.VarSpecMessage.widget:type_name -> o2control.VarSpecMessage.UiWidget - 78, // 37: o2control.WorkflowTemplateInfo.varSpecMap:type_name -> o2control.WorkflowTemplateInfo.VarSpecMapEntry - 48, // 38: o2control.GetWorkflowTemplatesReply.workflowTemplates:type_name -> o2control.WorkflowTemplateInfo - 51, // 39: o2control.ListReposReply.repos:type_name -> o2control.RepoInfo - 79, // 40: o2control.ListIntegratedServicesReply.services:type_name -> o2control.ListIntegratedServicesReply.ServicesEntry - 47, // 41: o2control.WorkflowTemplateInfo.VarSpecMapEntry.value:type_name -> o2control.VarSpecMessage - 64, // 42: o2control.ListIntegratedServicesReply.ServicesEntry.value:type_name -> o2control.IntegratedServiceInfo - 5, // 43: o2control.Control.GetFrameworkInfo:input_type -> o2control.GetFrameworkInfoRequest - 10, // 44: o2control.Control.GetEnvironments:input_type -> o2control.GetEnvironmentsRequest - 15, // 45: o2control.Control.NewAutoEnvironment:input_type -> o2control.NewAutoEnvironmentRequest - 13, // 46: o2control.Control.NewEnvironment:input_type -> o2control.NewEnvironmentRequest - 17, // 47: o2control.Control.GetEnvironment:input_type -> o2control.GetEnvironmentRequest - 19, // 48: o2control.Control.ControlEnvironment:input_type -> o2control.ControlEnvironmentRequest - 24, // 49: o2control.Control.DestroyEnvironment:input_type -> o2control.DestroyEnvironmentRequest - 62, // 50: o2control.Control.GetActiveDetectors:input_type -> o2control.Empty - 62, // 51: o2control.Control.GetAvailableDetectors:input_type -> o2control.Empty - 13, // 52: o2control.Control.NewEnvironmentAsync:input_type -> o2control.NewEnvironmentRequest - 34, // 53: o2control.Control.GetTasks:input_type -> o2control.GetTasksRequest - 36, // 54: o2control.Control.GetTask:input_type -> o2control.GetTaskRequest - 41, // 55: o2control.Control.CleanupTasks:input_type -> o2control.CleanupTasksRequest - 43, // 56: o2control.Control.GetRoles:input_type -> o2control.GetRolesRequest - 46, // 57: o2control.Control.GetWorkflowTemplates:input_type -> o2control.GetWorkflowTemplatesRequest - 50, // 58: o2control.Control.ListRepos:input_type -> o2control.ListReposRequest - 53, // 59: o2control.Control.AddRepo:input_type -> o2control.AddRepoRequest - 55, // 60: o2control.Control.RemoveRepo:input_type -> o2control.RemoveRepoRequest - 57, // 61: o2control.Control.RefreshRepos:input_type -> o2control.RefreshReposRequest - 58, // 62: o2control.Control.SetDefaultRepo:input_type -> o2control.SetDefaultRepoRequest - 59, // 63: o2control.Control.SetGlobalDefaultRevision:input_type -> o2control.SetGlobalDefaultRevisionRequest - 60, // 64: o2control.Control.SetRepoDefaultRevision:input_type -> o2control.SetRepoDefaultRevisionRequest - 4, // 65: o2control.Control.Subscribe:input_type -> o2control.SubscribeRequest - 62, // 66: o2control.Control.GetIntegratedServices:input_type -> o2control.Empty - 8, // 67: o2control.Control.Teardown:input_type -> o2control.TeardownRequest - 21, // 68: o2control.Control.ModifyEnvironment:input_type -> o2control.ModifyEnvironmentRequest - 7, // 69: o2control.Control.GetFrameworkInfo:output_type -> o2control.GetFrameworkInfoReply - 11, // 70: o2control.Control.GetEnvironments:output_type -> o2control.GetEnvironmentsReply - 16, // 71: o2control.Control.NewAutoEnvironment:output_type -> o2control.NewAutoEnvironmentReply - 14, // 72: o2control.Control.NewEnvironment:output_type -> o2control.NewEnvironmentReply - 18, // 73: o2control.Control.GetEnvironment:output_type -> o2control.GetEnvironmentReply - 20, // 74: o2control.Control.ControlEnvironment:output_type -> o2control.ControlEnvironmentReply - 25, // 75: o2control.Control.DestroyEnvironment:output_type -> o2control.DestroyEnvironmentReply - 26, // 76: o2control.Control.GetActiveDetectors:output_type -> o2control.GetActiveDetectorsReply - 27, // 77: o2control.Control.GetAvailableDetectors:output_type -> o2control.GetAvailableDetectorsReply - 14, // 78: o2control.Control.NewEnvironmentAsync:output_type -> o2control.NewEnvironmentReply - 35, // 79: o2control.Control.GetTasks:output_type -> o2control.GetTasksReply - 37, // 80: o2control.Control.GetTask:output_type -> o2control.GetTaskReply - 42, // 81: o2control.Control.CleanupTasks:output_type -> o2control.CleanupTasksReply - 45, // 82: o2control.Control.GetRoles:output_type -> o2control.GetRolesReply - 49, // 83: o2control.Control.GetWorkflowTemplates:output_type -> o2control.GetWorkflowTemplatesReply - 52, // 84: o2control.Control.ListRepos:output_type -> o2control.ListReposReply - 54, // 85: o2control.Control.AddRepo:output_type -> o2control.AddRepoReply - 56, // 86: o2control.Control.RemoveRepo:output_type -> o2control.RemoveRepoReply - 62, // 87: o2control.Control.RefreshRepos:output_type -> o2control.Empty - 62, // 88: o2control.Control.SetDefaultRepo:output_type -> o2control.Empty - 62, // 89: o2control.Control.SetGlobalDefaultRevision:output_type -> o2control.Empty - 61, // 90: o2control.Control.SetRepoDefaultRevision:output_type -> o2control.SetRepoDefaultRevisionReply - 80, // 91: o2control.Control.Subscribe:output_type -> events.Event - 63, // 92: o2control.Control.GetIntegratedServices:output_type -> o2control.ListIntegratedServicesReply - 9, // 93: o2control.Control.Teardown:output_type -> o2control.TeardownReply - 23, // 94: o2control.Control.ModifyEnvironment:output_type -> o2control.ModifyEnvironmentReply - 69, // [69:95] is the sub-list for method output_type - 43, // [43:69] is the sub-list for method input_type - 43, // [43:43] is the sub-list for extension type_name - 43, // [43:43] is the sub-list for extension extendee - 0, // [0:43] is the sub-list for field type_name + 80, // 8: o2control.NewEnvironmentRequest.requestUser:type_name -> common.User + 12, // 9: o2control.NewEnvironmentReply.environment:type_name -> o2control.EnvironmentInfo + 70, // 10: o2control.NewAutoEnvironmentRequest.vars:type_name -> o2control.NewAutoEnvironmentRequest.VarsEntry + 80, // 11: o2control.NewAutoEnvironmentRequest.requestUser:type_name -> common.User + 12, // 12: o2control.GetEnvironmentReply.environment:type_name -> o2control.EnvironmentInfo + 44, // 13: o2control.GetEnvironmentReply.workflow:type_name -> o2control.RoleInfo + 0, // 14: o2control.ControlEnvironmentRequest.type:type_name -> o2control.ControlEnvironmentRequest.Optype + 80, // 15: o2control.ControlEnvironmentRequest.requestUser:type_name -> common.User + 22, // 16: o2control.ModifyEnvironmentRequest.operations:type_name -> o2control.EnvironmentOperation + 1, // 17: o2control.EnvironmentOperation.type:type_name -> o2control.EnvironmentOperation.Optype + 22, // 18: o2control.ModifyEnvironmentReply.failedOperations:type_name -> o2control.EnvironmentOperation + 80, // 19: o2control.DestroyEnvironmentRequest.requestUser:type_name -> common.User + 42, // 20: o2control.DestroyEnvironmentReply.cleanupTasksReply:type_name -> o2control.CleanupTasksReply + 71, // 21: o2control.SetEnvironmentPropertiesRequest.properties:type_name -> o2control.SetEnvironmentPropertiesRequest.PropertiesEntry + 72, // 22: o2control.GetEnvironmentPropertiesReply.properties:type_name -> o2control.GetEnvironmentPropertiesReply.PropertiesEntry + 33, // 23: o2control.ShortTaskInfo.deploymentInfo:type_name -> o2control.TaskDeploymentInfo + 32, // 24: o2control.GetTasksReply.tasks:type_name -> o2control.ShortTaskInfo + 40, // 25: o2control.GetTaskReply.task:type_name -> o2control.TaskInfo + 32, // 26: o2control.TaskInfo.shortInfo:type_name -> o2control.ShortTaskInfo + 39, // 27: o2control.TaskInfo.inboundChannels:type_name -> o2control.ChannelInfo + 39, // 28: o2control.TaskInfo.outboundChannels:type_name -> o2control.ChannelInfo + 38, // 29: o2control.TaskInfo.commandInfo:type_name -> o2control.CommandInfo + 73, // 30: o2control.TaskInfo.properties:type_name -> o2control.TaskInfo.PropertiesEntry + 32, // 31: o2control.CleanupTasksReply.killedTasks:type_name -> o2control.ShortTaskInfo + 32, // 32: o2control.CleanupTasksReply.runningTasks:type_name -> o2control.ShortTaskInfo + 44, // 33: o2control.RoleInfo.roles:type_name -> o2control.RoleInfo + 74, // 34: o2control.RoleInfo.defaults:type_name -> o2control.RoleInfo.DefaultsEntry + 75, // 35: o2control.RoleInfo.vars:type_name -> o2control.RoleInfo.VarsEntry + 76, // 36: o2control.RoleInfo.userVars:type_name -> o2control.RoleInfo.UserVarsEntry + 77, // 37: o2control.RoleInfo.consolidatedStack:type_name -> o2control.RoleInfo.ConsolidatedStackEntry + 44, // 38: o2control.GetRolesReply.roles:type_name -> o2control.RoleInfo + 3, // 39: o2control.VarSpecMessage.type:type_name -> o2control.VarSpecMessage.Type + 2, // 40: o2control.VarSpecMessage.widget:type_name -> o2control.VarSpecMessage.UiWidget + 78, // 41: o2control.WorkflowTemplateInfo.varSpecMap:type_name -> o2control.WorkflowTemplateInfo.VarSpecMapEntry + 48, // 42: o2control.GetWorkflowTemplatesReply.workflowTemplates:type_name -> o2control.WorkflowTemplateInfo + 51, // 43: o2control.ListReposReply.repos:type_name -> o2control.RepoInfo + 79, // 44: o2control.ListIntegratedServicesReply.services:type_name -> o2control.ListIntegratedServicesReply.ServicesEntry + 47, // 45: o2control.WorkflowTemplateInfo.VarSpecMapEntry.value:type_name -> o2control.VarSpecMessage + 64, // 46: o2control.ListIntegratedServicesReply.ServicesEntry.value:type_name -> o2control.IntegratedServiceInfo + 5, // 47: o2control.Control.GetFrameworkInfo:input_type -> o2control.GetFrameworkInfoRequest + 10, // 48: o2control.Control.GetEnvironments:input_type -> o2control.GetEnvironmentsRequest + 15, // 49: o2control.Control.NewAutoEnvironment:input_type -> o2control.NewAutoEnvironmentRequest + 13, // 50: o2control.Control.NewEnvironment:input_type -> o2control.NewEnvironmentRequest + 17, // 51: o2control.Control.GetEnvironment:input_type -> o2control.GetEnvironmentRequest + 19, // 52: o2control.Control.ControlEnvironment:input_type -> o2control.ControlEnvironmentRequest + 24, // 53: o2control.Control.DestroyEnvironment:input_type -> o2control.DestroyEnvironmentRequest + 62, // 54: o2control.Control.GetActiveDetectors:input_type -> o2control.Empty + 62, // 55: o2control.Control.GetAvailableDetectors:input_type -> o2control.Empty + 13, // 56: o2control.Control.NewEnvironmentAsync:input_type -> o2control.NewEnvironmentRequest + 34, // 57: o2control.Control.GetTasks:input_type -> o2control.GetTasksRequest + 36, // 58: o2control.Control.GetTask:input_type -> o2control.GetTaskRequest + 41, // 59: o2control.Control.CleanupTasks:input_type -> o2control.CleanupTasksRequest + 43, // 60: o2control.Control.GetRoles:input_type -> o2control.GetRolesRequest + 46, // 61: o2control.Control.GetWorkflowTemplates:input_type -> o2control.GetWorkflowTemplatesRequest + 50, // 62: o2control.Control.ListRepos:input_type -> o2control.ListReposRequest + 53, // 63: o2control.Control.AddRepo:input_type -> o2control.AddRepoRequest + 55, // 64: o2control.Control.RemoveRepo:input_type -> o2control.RemoveRepoRequest + 57, // 65: o2control.Control.RefreshRepos:input_type -> o2control.RefreshReposRequest + 58, // 66: o2control.Control.SetDefaultRepo:input_type -> o2control.SetDefaultRepoRequest + 59, // 67: o2control.Control.SetGlobalDefaultRevision:input_type -> o2control.SetGlobalDefaultRevisionRequest + 60, // 68: o2control.Control.SetRepoDefaultRevision:input_type -> o2control.SetRepoDefaultRevisionRequest + 4, // 69: o2control.Control.Subscribe:input_type -> o2control.SubscribeRequest + 62, // 70: o2control.Control.GetIntegratedServices:input_type -> o2control.Empty + 8, // 71: o2control.Control.Teardown:input_type -> o2control.TeardownRequest + 21, // 72: o2control.Control.ModifyEnvironment:input_type -> o2control.ModifyEnvironmentRequest + 7, // 73: o2control.Control.GetFrameworkInfo:output_type -> o2control.GetFrameworkInfoReply + 11, // 74: o2control.Control.GetEnvironments:output_type -> o2control.GetEnvironmentsReply + 16, // 75: o2control.Control.NewAutoEnvironment:output_type -> o2control.NewAutoEnvironmentReply + 14, // 76: o2control.Control.NewEnvironment:output_type -> o2control.NewEnvironmentReply + 18, // 77: o2control.Control.GetEnvironment:output_type -> o2control.GetEnvironmentReply + 20, // 78: o2control.Control.ControlEnvironment:output_type -> o2control.ControlEnvironmentReply + 25, // 79: o2control.Control.DestroyEnvironment:output_type -> o2control.DestroyEnvironmentReply + 26, // 80: o2control.Control.GetActiveDetectors:output_type -> o2control.GetActiveDetectorsReply + 27, // 81: o2control.Control.GetAvailableDetectors:output_type -> o2control.GetAvailableDetectorsReply + 14, // 82: o2control.Control.NewEnvironmentAsync:output_type -> o2control.NewEnvironmentReply + 35, // 83: o2control.Control.GetTasks:output_type -> o2control.GetTasksReply + 37, // 84: o2control.Control.GetTask:output_type -> o2control.GetTaskReply + 42, // 85: o2control.Control.CleanupTasks:output_type -> o2control.CleanupTasksReply + 45, // 86: o2control.Control.GetRoles:output_type -> o2control.GetRolesReply + 49, // 87: o2control.Control.GetWorkflowTemplates:output_type -> o2control.GetWorkflowTemplatesReply + 52, // 88: o2control.Control.ListRepos:output_type -> o2control.ListReposReply + 54, // 89: o2control.Control.AddRepo:output_type -> o2control.AddRepoReply + 56, // 90: o2control.Control.RemoveRepo:output_type -> o2control.RemoveRepoReply + 62, // 91: o2control.Control.RefreshRepos:output_type -> o2control.Empty + 62, // 92: o2control.Control.SetDefaultRepo:output_type -> o2control.Empty + 62, // 93: o2control.Control.SetGlobalDefaultRevision:output_type -> o2control.Empty + 61, // 94: o2control.Control.SetRepoDefaultRevision:output_type -> o2control.SetRepoDefaultRevisionReply + 81, // 95: o2control.Control.Subscribe:output_type -> events.Event + 63, // 96: o2control.Control.GetIntegratedServices:output_type -> o2control.ListIntegratedServicesReply + 9, // 97: o2control.Control.Teardown:output_type -> o2control.TeardownReply + 23, // 98: o2control.Control.ModifyEnvironment:output_type -> o2control.ModifyEnvironmentReply + 73, // [73:99] is the sub-list for method output_type + 47, // [47:73] is the sub-list for method input_type + 47, // [47:47] is the sub-list for extension type_name + 47, // [47:47] is the sub-list for extension extendee + 0, // [0:47] is the sub-list for field type_name } func init() { file_protos_o2control_proto_init() } diff --git a/core/protos/o2control.proto b/core/protos/o2control.proto index f301241d..ee9bd974 100644 --- a/core/protos/o2control.proto +++ b/core/protos/o2control.proto @@ -145,6 +145,7 @@ message NewEnvironmentRequest { map vars = 2; bool public = 3; bool autoTransition = 4; + common.User requestUser = 5; } message NewEnvironmentReply { EnvironmentInfo environment = 1; @@ -154,6 +155,7 @@ message NewAutoEnvironmentRequest { string workflowTemplate = 1; map vars = 2; string id = 3; + common.User requestUser = 4; } message NewAutoEnvironmentReply { @@ -181,6 +183,7 @@ message ControlEnvironmentRequest { DEPLOY = 6; } Optype type = 2; + common.User requestUser = 3; } message ControlEnvironmentReply { string id = 1; @@ -217,6 +220,7 @@ message DestroyEnvironmentRequest { bool keepTasks = 2; bool allowInRunningState = 3; bool force = 4; + common.User requestUser = 5; } message DestroyEnvironmentReply { CleanupTasksReply cleanupTasksReply = 1; diff --git a/core/server.go b/core/server.go index 18b144b7..3ff3bd9a 100644 --- a/core/server.go +++ b/core/server.go @@ -296,13 +296,21 @@ func (m *RpcServer) GetEnvironments(cxt context.Context, request *pb.GetEnvironm func (m *RpcServer) doNewEnvironmentAsync(cxt context.Context, request *pb.NewEnvironmentRequest, id uid.ID) { var err error - id, err = m.state.environments.CreateEnvironment(request.GetWorkflowTemplate(), request.GetVars(), request.GetPublic(), id, request.GetAutoTransition()) + userVars := request.GetVars() + if len(userVars) == 0 { + userVars = make(map[string]string) + } + // we store the last known request user in the environment + lastRequestUserJ, _ := json.Marshal(request.RequestUser) + userVars["last_request_user"] = string(lastRequestUserJ[:]) + id, err = m.state.environments.CreateEnvironment(request.GetWorkflowTemplate(), userVars, request.GetPublic(), id, request.GetAutoTransition()) if err != nil { the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: id.String(), - State: "ERROR", - Error: "cannot create new environment", - Message: err.Error(), + EnvironmentId: id.String(), + State: "ERROR", + Error: "cannot create new environment", + Message: err.Error(), + LastRequestUser: request.RequestUser, }) return } @@ -310,17 +318,19 @@ func (m *RpcServer) doNewEnvironmentAsync(cxt context.Context, request *pb.NewEn newEnv, err := m.state.environments.Environment(id) if err != nil { the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: id.String(), - State: "ERROR", - Error: "cannot get newly created environment", - Message: err.Error(), + EnvironmentId: id.String(), + State: "ERROR", + Error: "cannot get newly created environment", + Message: err.Error(), + LastRequestUser: request.RequestUser, }) return } the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ - EnvironmentId: id.String(), - State: newEnv.CurrentState(), + EnvironmentId: id.String(), + State: newEnv.CurrentState(), + LastRequestUser: request.RequestUser, }) return } @@ -376,9 +386,17 @@ func (m *RpcServer) NewEnvironment(cxt context.Context, request *pb.NewEnvironme reply = &pb.NewEnvironmentReply{Public: request.Public} + inputUserVars := request.GetVars() + if len(inputUserVars) == 0 { + inputUserVars = make(map[string]string) + } + // we store the last known request user in the environment + lastRequestUserJ, _ := json.Marshal(request.RequestUser) + inputUserVars["last_request_user"] = string(lastRequestUserJ[:]) + // Create new Environment instance with some roles, we get back a UUID id := uid.New() - id, err = m.state.environments.CreateEnvironment(request.GetWorkflowTemplate(), request.GetVars(), request.GetPublic(), id, request.GetAutoTransition()) + id, err = m.state.environments.CreateEnvironment(request.GetWorkflowTemplate(), inputUserVars, request.GetPublic(), id, request.GetAutoTransition()) if err != nil { st := status.Newf(codes.Internal, "cannot create new environment: %s", utils.TruncateString(err.Error(), MAX_ERROR_LENGTH)) ei := &pb.EnvironmentInfo{ @@ -575,6 +593,8 @@ func (m *RpcServer) ControlEnvironment(cxt context.Context, req *pb.ControlEnvir return nil, status.Newf(codes.NotFound, "environment not found: %s", err.Error()).Err() } + env.SetLastRequestUser(req.RequestUser) + trans := environment.MakeTransition(m.state.taskman, req.Type) if trans == nil { return nil, status.Newf(codes.InvalidArgument, "cannot prepare invalid transition %s", req.GetType().String()).Err() @@ -639,6 +659,8 @@ func (m *RpcServer) DestroyEnvironment(cxt context.Context, req *pb.DestroyEnvir return nil, status.Newf(codes.NotFound, "environment not found: %s", err.Error()).Err() } + env.SetLastRequestUser(req.RequestUser) + // if Force immediately disband the environment (unlocking all tasks) and run the cleanup. if req.Force { return m.doTeardownAndCleanup(env, req.Force, req.KeepTasks)