diff --git a/elixir/lib/protobuf/operation_completed.pb.ex b/elixir/lib/protobuf/operation_completed.pb.ex new file mode 100644 index 0000000..70937f1 --- /dev/null +++ b/elixir/lib/protobuf/operation_completed.pb.ex @@ -0,0 +1,23 @@ +defmodule Trento.Operations.V1.OperationResult do + @moduledoc false + + use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + + field :UPDATED, 0 + field :NOT_UPDATED, 1 + field :ROLLED_BACK, 2 + field :FAILED, 3 + field :ABORTED, 4 + field :ALREADY_RUNNING, 5 +end + +defmodule Trento.Operations.V1.OperationCompleted do + @moduledoc false + + use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + + field :operation_id, 1, type: :string, json_name: "operationId" + field :group_id, 2, type: :string, json_name: "groupId" + field :operation_type, 3, type: :string, json_name: "operationType" + field :result, 4, type: Trento.Operations.V1.OperationResult, enum: true +end diff --git a/elixir/lib/protobuf/operation_requested.pb.ex b/elixir/lib/protobuf/operation_requested.pb.ex new file mode 100644 index 0000000..81b8561 --- /dev/null +++ b/elixir/lib/protobuf/operation_requested.pb.ex @@ -0,0 +1,10 @@ +defmodule Trento.Operations.V1.OperationRequested do + @moduledoc false + + use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + + field :operation_id, 1, type: :string, json_name: "operationId" + field :group_id, 2, type: :string, json_name: "groupId" + field :operation_type, 3, type: :string, json_name: "operationType" + field :targets, 4, repeated: true, type: Trento.Operations.V1.OperationTarget +end diff --git a/elixir/lib/protobuf/operation_started.pb.ex b/elixir/lib/protobuf/operation_started.pb.ex new file mode 100644 index 0000000..5cd4df4 --- /dev/null +++ b/elixir/lib/protobuf/operation_started.pb.ex @@ -0,0 +1,10 @@ +defmodule Trento.Operations.V1.OperationStarted do + @moduledoc false + + use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + + field :operation_id, 1, type: :string, json_name: "operationId" + field :group_id, 2, type: :string, json_name: "groupId" + field :operation_type, 3, type: :string, json_name: "operationType" + field :targets, 4, repeated: true, type: Trento.Operations.V1.OperationTarget +end diff --git a/elixir/lib/protobuf/operation_target.pb.ex b/elixir/lib/protobuf/operation_target.pb.ex new file mode 100644 index 0000000..23c5e3e --- /dev/null +++ b/elixir/lib/protobuf/operation_target.pb.ex @@ -0,0 +1,21 @@ +defmodule Trento.Operations.V1.OperationTarget.ArgumentsEntry do + @moduledoc false + + use Protobuf, map: true, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + + field :key, 1, type: :string + field :value, 2, type: Google.Protobuf.Value +end + +defmodule Trento.Operations.V1.OperationTarget do + @moduledoc false + + use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 + + field :agent_id, 1, type: :string, json_name: "agentId" + + field :arguments, 2, + repeated: true, + type: Trento.Operations.V1.OperationTarget.ArgumentsEntry, + map: true +end diff --git a/go/pkg/events/operation_completed.pb.go b/go/pkg/events/operation_completed.pb.go new file mode 100644 index 0000000..485b805 --- /dev/null +++ b/go/pkg/events/operation_completed.pb.go @@ -0,0 +1,246 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.20.1 +// source: protobuf/operation_completed.proto + +package events + +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 OperationResult int32 + +const ( + OperationResult_UPDATED OperationResult = 0 + OperationResult_NOT_UPDATED OperationResult = 1 + OperationResult_ROLLED_BACK OperationResult = 2 + OperationResult_FAILED OperationResult = 3 + OperationResult_ABORTED OperationResult = 4 + OperationResult_ALREADY_RUNNING OperationResult = 5 +) + +// Enum value maps for OperationResult. +var ( + OperationResult_name = map[int32]string{ + 0: "UPDATED", + 1: "NOT_UPDATED", + 2: "ROLLED_BACK", + 3: "FAILED", + 4: "ABORTED", + 5: "ALREADY_RUNNING", + } + OperationResult_value = map[string]int32{ + "UPDATED": 0, + "NOT_UPDATED": 1, + "ROLLED_BACK": 2, + "FAILED": 3, + "ABORTED": 4, + "ALREADY_RUNNING": 5, + } +) + +func (x OperationResult) Enum() *OperationResult { + p := new(OperationResult) + *p = x + return p +} + +func (x OperationResult) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OperationResult) Descriptor() protoreflect.EnumDescriptor { + return file_protobuf_operation_completed_proto_enumTypes[0].Descriptor() +} + +func (OperationResult) Type() protoreflect.EnumType { + return &file_protobuf_operation_completed_proto_enumTypes[0] +} + +func (x OperationResult) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OperationResult.Descriptor instead. +func (OperationResult) EnumDescriptor() ([]byte, []int) { + return file_protobuf_operation_completed_proto_rawDescGZIP(), []int{0} +} + +type OperationCompleted struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` + GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + OperationType string `protobuf:"bytes,3,opt,name=operation_type,json=operationType,proto3" json:"operation_type,omitempty"` + Result OperationResult `protobuf:"varint,4,opt,name=result,proto3,enum=Trento.Operations.V1.OperationResult" json:"result,omitempty"` +} + +func (x *OperationCompleted) Reset() { + *x = OperationCompleted{} + if protoimpl.UnsafeEnabled { + mi := &file_protobuf_operation_completed_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OperationCompleted) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OperationCompleted) ProtoMessage() {} + +func (x *OperationCompleted) ProtoReflect() protoreflect.Message { + mi := &file_protobuf_operation_completed_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 OperationCompleted.ProtoReflect.Descriptor instead. +func (*OperationCompleted) Descriptor() ([]byte, []int) { + return file_protobuf_operation_completed_proto_rawDescGZIP(), []int{0} +} + +func (x *OperationCompleted) GetOperationId() string { + if x != nil { + return x.OperationId + } + return "" +} + +func (x *OperationCompleted) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *OperationCompleted) GetOperationType() string { + if x != nil { + return x.OperationType + } + return "" +} + +func (x *OperationCompleted) GetResult() OperationResult { + if x != nil { + return x.Result + } + return OperationResult_UPDATED +} + +var File_protobuf_operation_completed_proto protoreflect.FileDescriptor + +var file_protobuf_operation_completed_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x54, 0x72, 0x65, 0x6e, 0x74, 0x6f, 0x2e, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x56, 0x31, 0x22, 0xb8, 0x01, 0x0a, 0x12, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, + 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, + 0x25, 0x0a, 0x0e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x54, 0x72, 0x65, 0x6e, 0x74, 0x6f, 0x2e, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x56, 0x31, 0x2e, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2a, 0x6e, 0x0a, 0x0f, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x50, 0x44, 0x41, + 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x55, 0x50, 0x44, + 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x4f, 0x4c, 0x4c, 0x45, 0x44, + 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, + 0x44, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x41, 0x42, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x10, 0x04, + 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x52, 0x55, 0x4e, 0x4e, + 0x49, 0x4e, 0x47, 0x10, 0x05, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_protobuf_operation_completed_proto_rawDescOnce sync.Once + file_protobuf_operation_completed_proto_rawDescData = file_protobuf_operation_completed_proto_rawDesc +) + +func file_protobuf_operation_completed_proto_rawDescGZIP() []byte { + file_protobuf_operation_completed_proto_rawDescOnce.Do(func() { + file_protobuf_operation_completed_proto_rawDescData = protoimpl.X.CompressGZIP(file_protobuf_operation_completed_proto_rawDescData) + }) + return file_protobuf_operation_completed_proto_rawDescData +} + +var file_protobuf_operation_completed_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_protobuf_operation_completed_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_protobuf_operation_completed_proto_goTypes = []interface{}{ + (OperationResult)(0), // 0: Trento.Operations.V1.OperationResult + (*OperationCompleted)(nil), // 1: Trento.Operations.V1.OperationCompleted +} +var file_protobuf_operation_completed_proto_depIdxs = []int32{ + 0, // 0: Trento.Operations.V1.OperationCompleted.result:type_name -> Trento.Operations.V1.OperationResult + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_protobuf_operation_completed_proto_init() } +func file_protobuf_operation_completed_proto_init() { + if File_protobuf_operation_completed_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_protobuf_operation_completed_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OperationCompleted); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_protobuf_operation_completed_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_protobuf_operation_completed_proto_goTypes, + DependencyIndexes: file_protobuf_operation_completed_proto_depIdxs, + EnumInfos: file_protobuf_operation_completed_proto_enumTypes, + MessageInfos: file_protobuf_operation_completed_proto_msgTypes, + }.Build() + File_protobuf_operation_completed_proto = out.File + file_protobuf_operation_completed_proto_rawDesc = nil + file_protobuf_operation_completed_proto_goTypes = nil + file_protobuf_operation_completed_proto_depIdxs = nil +} diff --git a/go/pkg/events/operation_requested.pb.go b/go/pkg/events/operation_requested.pb.go new file mode 100644 index 0000000..12a197d --- /dev/null +++ b/go/pkg/events/operation_requested.pb.go @@ -0,0 +1,182 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.20.1 +// source: protobuf/operation_requested.proto + +package events + +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 OperationRequested struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` + GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + OperationType string `protobuf:"bytes,3,opt,name=operation_type,json=operationType,proto3" json:"operation_type,omitempty"` + Targets []*OperationTarget `protobuf:"bytes,4,rep,name=targets,proto3" json:"targets,omitempty"` +} + +func (x *OperationRequested) Reset() { + *x = OperationRequested{} + if protoimpl.UnsafeEnabled { + mi := &file_protobuf_operation_requested_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OperationRequested) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OperationRequested) ProtoMessage() {} + +func (x *OperationRequested) ProtoReflect() protoreflect.Message { + mi := &file_protobuf_operation_requested_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 OperationRequested.ProtoReflect.Descriptor instead. +func (*OperationRequested) Descriptor() ([]byte, []int) { + return file_protobuf_operation_requested_proto_rawDescGZIP(), []int{0} +} + +func (x *OperationRequested) GetOperationId() string { + if x != nil { + return x.OperationId + } + return "" +} + +func (x *OperationRequested) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *OperationRequested) GetOperationType() string { + if x != nil { + return x.OperationType + } + return "" +} + +func (x *OperationRequested) GetTargets() []*OperationTarget { + if x != nil { + return x.Targets + } + return nil +} + +var File_protobuf_operation_requested_proto protoreflect.FileDescriptor + +var file_protobuf_operation_requested_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x54, 0x72, 0x65, 0x6e, 0x74, 0x6f, 0x2e, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x56, 0x31, 0x1a, 0x1f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xba, 0x01, 0x0a, 0x12, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, + 0x12, 0x25, 0x0a, 0x0e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x54, 0x72, 0x65, 0x6e, 0x74, + 0x6f, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x56, 0x31, 0x2e, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, + 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x3b, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_protobuf_operation_requested_proto_rawDescOnce sync.Once + file_protobuf_operation_requested_proto_rawDescData = file_protobuf_operation_requested_proto_rawDesc +) + +func file_protobuf_operation_requested_proto_rawDescGZIP() []byte { + file_protobuf_operation_requested_proto_rawDescOnce.Do(func() { + file_protobuf_operation_requested_proto_rawDescData = protoimpl.X.CompressGZIP(file_protobuf_operation_requested_proto_rawDescData) + }) + return file_protobuf_operation_requested_proto_rawDescData +} + +var file_protobuf_operation_requested_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_protobuf_operation_requested_proto_goTypes = []interface{}{ + (*OperationRequested)(nil), // 0: Trento.Operations.V1.OperationRequested + (*OperationTarget)(nil), // 1: Trento.Operations.V1.OperationTarget +} +var file_protobuf_operation_requested_proto_depIdxs = []int32{ + 1, // 0: Trento.Operations.V1.OperationRequested.targets:type_name -> Trento.Operations.V1.OperationTarget + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_protobuf_operation_requested_proto_init() } +func file_protobuf_operation_requested_proto_init() { + if File_protobuf_operation_requested_proto != nil { + return + } + file_protobuf_operation_target_proto_init() + if !protoimpl.UnsafeEnabled { + file_protobuf_operation_requested_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OperationRequested); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_protobuf_operation_requested_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_protobuf_operation_requested_proto_goTypes, + DependencyIndexes: file_protobuf_operation_requested_proto_depIdxs, + MessageInfos: file_protobuf_operation_requested_proto_msgTypes, + }.Build() + File_protobuf_operation_requested_proto = out.File + file_protobuf_operation_requested_proto_rawDesc = nil + file_protobuf_operation_requested_proto_goTypes = nil + file_protobuf_operation_requested_proto_depIdxs = nil +} diff --git a/go/pkg/events/operation_started.pb.go b/go/pkg/events/operation_started.pb.go new file mode 100644 index 0000000..b98b45a --- /dev/null +++ b/go/pkg/events/operation_started.pb.go @@ -0,0 +1,182 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.20.1 +// source: protobuf/operation_started.proto + +package events + +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 OperationStarted struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` + GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + OperationType string `protobuf:"bytes,3,opt,name=operation_type,json=operationType,proto3" json:"operation_type,omitempty"` + Targets []*OperationTarget `protobuf:"bytes,4,rep,name=targets,proto3" json:"targets,omitempty"` +} + +func (x *OperationStarted) Reset() { + *x = OperationStarted{} + if protoimpl.UnsafeEnabled { + mi := &file_protobuf_operation_started_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OperationStarted) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OperationStarted) ProtoMessage() {} + +func (x *OperationStarted) ProtoReflect() protoreflect.Message { + mi := &file_protobuf_operation_started_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 OperationStarted.ProtoReflect.Descriptor instead. +func (*OperationStarted) Descriptor() ([]byte, []int) { + return file_protobuf_operation_started_proto_rawDescGZIP(), []int{0} +} + +func (x *OperationStarted) GetOperationId() string { + if x != nil { + return x.OperationId + } + return "" +} + +func (x *OperationStarted) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *OperationStarted) GetOperationType() string { + if x != nil { + return x.OperationType + } + return "" +} + +func (x *OperationStarted) GetTargets() []*OperationTarget { + if x != nil { + return x.Targets + } + return nil +} + +var File_protobuf_operation_started_proto protoreflect.FileDescriptor + +var file_protobuf_operation_started_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x14, 0x54, 0x72, 0x65, 0x6e, 0x74, 0x6f, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x56, 0x31, 0x1a, 0x1f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb8, 0x01, 0x0a, 0x10, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x21, + 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x54, 0x72, 0x65, 0x6e, 0x74, 0x6f, 0x2e, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x56, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x73, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_protobuf_operation_started_proto_rawDescOnce sync.Once + file_protobuf_operation_started_proto_rawDescData = file_protobuf_operation_started_proto_rawDesc +) + +func file_protobuf_operation_started_proto_rawDescGZIP() []byte { + file_protobuf_operation_started_proto_rawDescOnce.Do(func() { + file_protobuf_operation_started_proto_rawDescData = protoimpl.X.CompressGZIP(file_protobuf_operation_started_proto_rawDescData) + }) + return file_protobuf_operation_started_proto_rawDescData +} + +var file_protobuf_operation_started_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_protobuf_operation_started_proto_goTypes = []interface{}{ + (*OperationStarted)(nil), // 0: Trento.Operations.V1.OperationStarted + (*OperationTarget)(nil), // 1: Trento.Operations.V1.OperationTarget +} +var file_protobuf_operation_started_proto_depIdxs = []int32{ + 1, // 0: Trento.Operations.V1.OperationStarted.targets:type_name -> Trento.Operations.V1.OperationTarget + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_protobuf_operation_started_proto_init() } +func file_protobuf_operation_started_proto_init() { + if File_protobuf_operation_started_proto != nil { + return + } + file_protobuf_operation_target_proto_init() + if !protoimpl.UnsafeEnabled { + file_protobuf_operation_started_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OperationStarted); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_protobuf_operation_started_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_protobuf_operation_started_proto_goTypes, + DependencyIndexes: file_protobuf_operation_started_proto_depIdxs, + MessageInfos: file_protobuf_operation_started_proto_msgTypes, + }.Build() + File_protobuf_operation_started_proto = out.File + file_protobuf_operation_started_proto_rawDesc = nil + file_protobuf_operation_started_proto_goTypes = nil + file_protobuf_operation_started_proto_depIdxs = nil +} diff --git a/go/pkg/events/operation_target.pb.go b/go/pkg/events/operation_target.pb.go new file mode 100644 index 0000000..1b513de --- /dev/null +++ b/go/pkg/events/operation_target.pb.go @@ -0,0 +1,170 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.20.1 +// source: protobuf/operation_target.proto + +package events + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + 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 OperationTarget struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + Arguments map[string]*structpb.Value `protobuf:"bytes,2,rep,name=arguments,proto3" json:"arguments,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *OperationTarget) Reset() { + *x = OperationTarget{} + if protoimpl.UnsafeEnabled { + mi := &file_protobuf_operation_target_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OperationTarget) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OperationTarget) ProtoMessage() {} + +func (x *OperationTarget) ProtoReflect() protoreflect.Message { + mi := &file_protobuf_operation_target_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 OperationTarget.ProtoReflect.Descriptor instead. +func (*OperationTarget) Descriptor() ([]byte, []int) { + return file_protobuf_operation_target_proto_rawDescGZIP(), []int{0} +} + +func (x *OperationTarget) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +func (x *OperationTarget) GetArguments() map[string]*structpb.Value { + if x != nil { + return x.Arguments + } + return nil +} + +var File_protobuf_operation_target_proto protoreflect.FileDescriptor + +var file_protobuf_operation_target_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x14, 0x54, 0x72, 0x65, 0x6e, 0x74, 0x6f, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x56, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6, 0x01, 0x0a, 0x0f, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x49, 0x64, 0x12, 0x52, 0x0a, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x54, 0x72, 0x65, 0x6e, 0x74, 0x6f, + 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x56, 0x31, 0x2e, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, 0x41, + 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x61, + 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x54, 0x0a, 0x0e, 0x41, 0x72, 0x67, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 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, 0x2c, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0a, + 0x5a, 0x08, 0x2f, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_protobuf_operation_target_proto_rawDescOnce sync.Once + file_protobuf_operation_target_proto_rawDescData = file_protobuf_operation_target_proto_rawDesc +) + +func file_protobuf_operation_target_proto_rawDescGZIP() []byte { + file_protobuf_operation_target_proto_rawDescOnce.Do(func() { + file_protobuf_operation_target_proto_rawDescData = protoimpl.X.CompressGZIP(file_protobuf_operation_target_proto_rawDescData) + }) + return file_protobuf_operation_target_proto_rawDescData +} + +var file_protobuf_operation_target_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_protobuf_operation_target_proto_goTypes = []interface{}{ + (*OperationTarget)(nil), // 0: Trento.Operations.V1.OperationTarget + nil, // 1: Trento.Operations.V1.OperationTarget.ArgumentsEntry + (*structpb.Value)(nil), // 2: google.protobuf.Value +} +var file_protobuf_operation_target_proto_depIdxs = []int32{ + 1, // 0: Trento.Operations.V1.OperationTarget.arguments:type_name -> Trento.Operations.V1.OperationTarget.ArgumentsEntry + 2, // 1: Trento.Operations.V1.OperationTarget.ArgumentsEntry.value:type_name -> google.protobuf.Value + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_protobuf_operation_target_proto_init() } +func file_protobuf_operation_target_proto_init() { + if File_protobuf_operation_target_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_protobuf_operation_target_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OperationTarget); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_protobuf_operation_target_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_protobuf_operation_target_proto_goTypes, + DependencyIndexes: file_protobuf_operation_target_proto_depIdxs, + MessageInfos: file_protobuf_operation_target_proto_msgTypes, + }.Build() + File_protobuf_operation_target_proto = out.File + file_protobuf_operation_target_proto_rawDesc = nil + file_protobuf_operation_target_proto_goTypes = nil + file_protobuf_operation_target_proto_depIdxs = nil +} diff --git a/protobuf/operation_completed.proto b/protobuf/operation_completed.proto new file mode 100644 index 0000000..e2b490a --- /dev/null +++ b/protobuf/operation_completed.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package Trento.Operations.V1; +option go_package = "/;events"; + +enum OperationResult { + UPDATED = 0; + NOT_UPDATED = 1; + ROLLED_BACK = 2; + FAILED = 3; + ABORTED = 4; + ALREADY_RUNNING = 5; +} + +message OperationCompleted { + string operation_id = 1; + string group_id = 2; + string operation_type = 3; + OperationResult result = 4; +} \ No newline at end of file diff --git a/protobuf/operation_requested.proto b/protobuf/operation_requested.proto new file mode 100644 index 0000000..3abae20 --- /dev/null +++ b/protobuf/operation_requested.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package Trento.Operations.V1; +option go_package = "/;events"; + +import "protobuf/operation_target.proto"; + +message OperationRequested { + string operation_id = 1; + string group_id = 2; + string operation_type = 3; + repeated OperationTarget targets = 4; +} \ No newline at end of file diff --git a/protobuf/operation_started.proto b/protobuf/operation_started.proto new file mode 100644 index 0000000..80bc0c5 --- /dev/null +++ b/protobuf/operation_started.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package Trento.Operations.V1; +option go_package = "/;events"; + +import "protobuf/operation_target.proto"; + +message OperationStarted { + string operation_id = 1; + string group_id = 2; + string operation_type = 3; + repeated OperationTarget targets = 4; +} \ No newline at end of file diff --git a/protobuf/operation_target.proto b/protobuf/operation_target.proto new file mode 100644 index 0000000..328f89c --- /dev/null +++ b/protobuf/operation_target.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package Trento.Operations.V1; +option go_package = "/;events"; + +import "google/protobuf/struct.proto"; + +message OperationTarget { + string agent_id = 1; + map arguments = 2; +} \ No newline at end of file