From a49ff57a4637dea5755911c7b680afec7cf2b202 Mon Sep 17 00:00:00 2001 From: Or Novogroder <108669655+OrNovo@users.noreply.github.com> Date: Sun, 17 Dec 2023 15:16:02 +0200 Subject: [PATCH] Archive setup (#181) * patch - archive_retentions --- CHANGELOG.md | 7 +- coralogix/clientset/archive-retentions.go | 67 ++ coralogix/clientset/clientset.go | 7 + .../grpc/archive-retentions/retention.pb.go | 189 ++++ .../retentions_service.pb.go | 804 ++++++++++++++++++ .../retentions_service_grpc.pb.go | 213 +++++ .../clientset/grpc/archive-setup/target.pb.go | 434 ++++++++++ .../grpc/archive-setup/target_service.pb.go | 415 +++++++++ .../archive-setup/target_service_grpc.pb.go | 141 +++ .../recording-rules-groups-sets-client.go | 2 - ...data_source_coralogix_archive_retention.go | 99 +++ ...source_coralogix_archive_retention_test.go | 31 + coralogix/provider.go | 2 + coralogix/resource_coralogix_alert.go | 8 +- .../resource_coralogix_archive_retention.go | 402 +++++++++ ...source_coralogix_archive_retention_test.go | 81 ++ coralogix/resource_coralogix_data_set.go | 2 +- coralogix/resource_coralogix_webhook.go | 2 +- coralogix/utils.go | 18 +- docs/data-sources/archive_retentions.md | 35 + docs/resources/archive_retentions.md | 51 ++ examples/archive_retentions/main.tf | 32 + 22 files changed, 3021 insertions(+), 21 deletions(-) create mode 100644 coralogix/clientset/archive-retentions.go create mode 100644 coralogix/clientset/grpc/archive-retentions/retention.pb.go create mode 100644 coralogix/clientset/grpc/archive-retentions/retentions_service.pb.go create mode 100644 coralogix/clientset/grpc/archive-retentions/retentions_service_grpc.pb.go create mode 100644 coralogix/clientset/grpc/archive-setup/target.pb.go create mode 100644 coralogix/clientset/grpc/archive-setup/target_service.pb.go create mode 100644 coralogix/clientset/grpc/archive-setup/target_service_grpc.pb.go create mode 100644 coralogix/data_source_coralogix_archive_retention.go create mode 100644 coralogix/data_source_coralogix_archive_retention_test.go create mode 100644 coralogix/resource_coralogix_archive_retention.go create mode 100644 coralogix/resource_coralogix_archive_retention_test.go create mode 100644 docs/data-sources/archive_retentions.md create mode 100644 docs/resources/archive_retentions.md create mode 100644 examples/archive_retentions/main.tf diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b709653..f4c1b3a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -375,4 +375,9 @@ Breaking Changes: ## Release 1.10.4 Breaking Changes: #### resource/coralogix_tco_policy_overrides -* the resource was deprecated and removed. \ No newline at end of file +* the resource was deprecated and removed. + +## Release 1.10.6 +New Features: +#### resource/coralogix_archive_retentions +* Adding support for `coralogix_archive_retentions` [resource](https://github.com/coralogix/terraform-provider-coralogix/tree/master/docs/resources/archive_retentions.md) and [data-source](https://github.com/coralogix/terraform-provider-coralogix/tree/master/docs/data-sources/archive_retentions.md). \ No newline at end of file diff --git a/coralogix/clientset/archive-retentions.go b/coralogix/clientset/archive-retentions.go new file mode 100644 index 00000000..727ce251 --- /dev/null +++ b/coralogix/clientset/archive-retentions.go @@ -0,0 +1,67 @@ +package clientset + +import ( + "context" + + archiveRetention "terraform-provider-coralogix/coralogix/clientset/grpc/archive-retentions" +) + +type ArchiveRetentionsClient struct { + callPropertiesCreator *CallPropertiesCreator +} + +func (c ArchiveRetentionsClient) GetRetentions(ctx context.Context, req *archiveRetention.GetRetentionsRequest) (*archiveRetention.GetRetentionsResponse, error) { + callProperties, err := c.callPropertiesCreator.GetCallProperties(ctx) + if err != nil { + return nil, err + } + + conn := callProperties.Connection + defer conn.Close() + client := archiveRetention.NewRetentionsServiceClient(conn) + + return client.GetRetentions(callProperties.Ctx, req, callProperties.CallOptions...) +} + +func (c ArchiveRetentionsClient) UpdateRetentions(ctx context.Context, req *archiveRetention.UpdateRetentionsRequest) (*archiveRetention.UpdateRetentionsResponse, error) { + callProperties, err := c.callPropertiesCreator.GetCallProperties(ctx) + if err != nil { + return nil, err + } + + conn := callProperties.Connection + defer conn.Close() + client := archiveRetention.NewRetentionsServiceClient(conn) + + return client.UpdateRetentions(callProperties.Ctx, req, callProperties.CallOptions...) +} + +func (c ArchiveRetentionsClient) ActivateRetentions(ctx context.Context, req *archiveRetention.ActivateRetentionsRequest) (*archiveRetention.ActivateRetentionsResponse, error) { + callProperties, err := c.callPropertiesCreator.GetCallProperties(ctx) + if err != nil { + return nil, err + } + + conn := callProperties.Connection + defer conn.Close() + client := archiveRetention.NewRetentionsServiceClient(conn) + + return client.ActivateRetentions(callProperties.Ctx, req, callProperties.CallOptions...) +} + +func (c ArchiveRetentionsClient) GetRetentionsEnabled(ctx context.Context, req *archiveRetention.GetRetentionsEnabledRequest) (*archiveRetention.GetRetentionsEnabledResponse, error) { + callProperties, err := c.callPropertiesCreator.GetCallProperties(ctx) + if err != nil { + return nil, err + } + + conn := callProperties.Connection + defer conn.Close() + client := archiveRetention.NewRetentionsServiceClient(conn) + + return client.GetRetentionsEnabled(callProperties.Ctx, req, callProperties.CallOptions...) +} + +func NewArchiveRetentionsClient(c *CallPropertiesCreator) *ArchiveRetentionsClient { + return &ArchiveRetentionsClient{callPropertiesCreator: c} +} diff --git a/coralogix/clientset/clientset.go b/coralogix/clientset/clientset.go index 125bef9e..d0f78b8b 100644 --- a/coralogix/clientset/clientset.go +++ b/coralogix/clientset/clientset.go @@ -14,6 +14,7 @@ type ClientSet struct { webhooks *WebhooksClient events2Metrics *Events2MetricsClient slis *SLIClient + archiveRetentions *ArchiveRetentionsClient } func (c *ClientSet) RuleGroups() *RuleGroupsClient { @@ -68,6 +69,11 @@ func (c *ClientSet) SLIs() *SLIClient { return c.slis } +func (c *ClientSet) ArchiveRetentions() *ArchiveRetentionsClient { + return c.archiveRetentions + +} + func NewClientSet(targetUrl, apiKey, teamsApiKey string) *ClientSet { apikeyCPC := NewCallPropertiesCreator(targetUrl, apiKey) _ = NewCallPropertiesCreator(targetUrl, teamsApiKey) @@ -86,5 +92,6 @@ func NewClientSet(targetUrl, apiKey, teamsApiKey string) *ClientSet { tcoPoliciesOverrides: NewTCOPoliciesOverridesClient(apikeyCPC), webhooks: NewWebhooksClient(apikeyCPC), slis: NewSLIsClient(apikeyCPC), + archiveRetentions: NewArchiveRetentionsClient(apikeyCPC), } } diff --git a/coralogix/clientset/grpc/archive-retentions/retention.pb.go b/coralogix/clientset/grpc/archive-retentions/retention.pb.go new file mode 100644 index 00000000..f89456bb --- /dev/null +++ b/coralogix/clientset/grpc/archive-retentions/retention.pb.go @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/archive/v1/retention.proto + +package __ + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + 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 Retention struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Order *wrapperspb.Int32Value `protobuf:"bytes,2,opt,name=order,proto3" json:"order,omitempty"` + Name *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Editable *wrapperspb.BoolValue `protobuf:"bytes,4,opt,name=editable,proto3" json:"editable,omitempty"` +} + +func (x *Retention) Reset() { + *x = Retention{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v1_retention_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Retention) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Retention) ProtoMessage() {} + +func (x *Retention) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v1_retention_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 Retention.ProtoReflect.Descriptor instead. +func (*Retention) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v1_retention_proto_rawDescGZIP(), []int{0} +} + +func (x *Retention) GetId() *wrapperspb.StringValue { + if x != nil { + return x.Id + } + return nil +} + +func (x *Retention) GetOrder() *wrapperspb.Int32Value { + if x != nil { + return x.Order + } + return nil +} + +func (x *Retention) GetName() *wrapperspb.StringValue { + if x != nil { + return x.Name + } + return nil +} + +func (x *Retention) GetEditable() *wrapperspb.BoolValue { + if x != nil { + return x.Editable + } + return nil +} + +var File_com_coralogix_archive_v1_retention_proto protoreflect.FileDescriptor + +var file_com_coralogix_archive_v1_retention_proto_rawDesc = []byte{ + 0x0a, 0x28, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x74, 0x65, 0x6e, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, + 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6, 0x01, 0x0a, 0x09, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x31, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x65, 0x64, 0x69, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x08, 0x65, 0x64, 0x69, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x03, 0x5a, + 0x01, 0x2e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_archive_v1_retention_proto_rawDescOnce sync.Once + file_com_coralogix_archive_v1_retention_proto_rawDescData = file_com_coralogix_archive_v1_retention_proto_rawDesc +) + +func file_com_coralogix_archive_v1_retention_proto_rawDescGZIP() []byte { + file_com_coralogix_archive_v1_retention_proto_rawDescOnce.Do(func() { + file_com_coralogix_archive_v1_retention_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_archive_v1_retention_proto_rawDescData) + }) + return file_com_coralogix_archive_v1_retention_proto_rawDescData +} + +var file_com_coralogix_archive_v1_retention_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_archive_v1_retention_proto_goTypes = []interface{}{ + (*Retention)(nil), // 0: com.coralogix.archive.v1.Retention + (*wrapperspb.StringValue)(nil), // 1: google.protobuf.StringValue + (*wrapperspb.Int32Value)(nil), // 2: google.protobuf.Int32Value + (*wrapperspb.BoolValue)(nil), // 3: google.protobuf.BoolValue +} +var file_com_coralogix_archive_v1_retention_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.archive.v1.Retention.id:type_name -> google.protobuf.StringValue + 2, // 1: com.coralogix.archive.v1.Retention.order:type_name -> google.protobuf.Int32Value + 1, // 2: com.coralogix.archive.v1.Retention.name:type_name -> google.protobuf.StringValue + 3, // 3: com.coralogix.archive.v1.Retention.editable:type_name -> google.protobuf.BoolValue + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_com_coralogix_archive_v1_retention_proto_init() } +func file_com_coralogix_archive_v1_retention_proto_init() { + if File_com_coralogix_archive_v1_retention_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_com_coralogix_archive_v1_retention_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Retention); 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_com_coralogix_archive_v1_retention_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_archive_v1_retention_proto_goTypes, + DependencyIndexes: file_com_coralogix_archive_v1_retention_proto_depIdxs, + MessageInfos: file_com_coralogix_archive_v1_retention_proto_msgTypes, + }.Build() + File_com_coralogix_archive_v1_retention_proto = out.File + file_com_coralogix_archive_v1_retention_proto_rawDesc = nil + file_com_coralogix_archive_v1_retention_proto_goTypes = nil + file_com_coralogix_archive_v1_retention_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/archive-retentions/retentions_service.pb.go b/coralogix/clientset/grpc/archive-retentions/retentions_service.pb.go new file mode 100644 index 00000000..78018f8c --- /dev/null +++ b/coralogix/clientset/grpc/archive-retentions/retentions_service.pb.go @@ -0,0 +1,804 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/archive/v1/retentions_service.proto + +package __ + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + 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 GetRetentionsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetRetentionsRequest) Reset() { + *x = GetRetentionsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRetentionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRetentionsRequest) ProtoMessage() {} + +func (x *GetRetentionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v1_retentions_service_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 GetRetentionsRequest.ProtoReflect.Descriptor instead. +func (*GetRetentionsRequest) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v1_retentions_service_proto_rawDescGZIP(), []int{0} +} + +type GetRetentionsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Retentions []*Retention `protobuf:"bytes,1,rep,name=retentions,proto3" json:"retentions,omitempty"` +} + +func (x *GetRetentionsResponse) Reset() { + *x = GetRetentionsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRetentionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRetentionsResponse) ProtoMessage() {} + +func (x *GetRetentionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[1] + 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 GetRetentionsResponse.ProtoReflect.Descriptor instead. +func (*GetRetentionsResponse) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v1_retentions_service_proto_rawDescGZIP(), []int{1} +} + +func (x *GetRetentionsResponse) GetRetentions() []*Retention { + if x != nil { + return x.Retentions + } + return nil +} + +type RetentionUpdateElement struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *RetentionUpdateElement) Reset() { + *x = RetentionUpdateElement{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RetentionUpdateElement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RetentionUpdateElement) ProtoMessage() {} + +func (x *RetentionUpdateElement) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[2] + 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 RetentionUpdateElement.ProtoReflect.Descriptor instead. +func (*RetentionUpdateElement) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v1_retentions_service_proto_rawDescGZIP(), []int{2} +} + +func (x *RetentionUpdateElement) GetId() *wrapperspb.StringValue { + if x != nil { + return x.Id + } + return nil +} + +func (x *RetentionUpdateElement) GetName() *wrapperspb.StringValue { + if x != nil { + return x.Name + } + return nil +} + +type UpdateRetentionsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RetentionUpdateElements []*RetentionUpdateElement `protobuf:"bytes,1,rep,name=retention_update_elements,json=retentionUpdateElements,proto3" json:"retention_update_elements,omitempty"` +} + +func (x *UpdateRetentionsRequest) Reset() { + *x = UpdateRetentionsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateRetentionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRetentionsRequest) ProtoMessage() {} + +func (x *UpdateRetentionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[3] + 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 UpdateRetentionsRequest.ProtoReflect.Descriptor instead. +func (*UpdateRetentionsRequest) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v1_retentions_service_proto_rawDescGZIP(), []int{3} +} + +func (x *UpdateRetentionsRequest) GetRetentionUpdateElements() []*RetentionUpdateElement { + if x != nil { + return x.RetentionUpdateElements + } + return nil +} + +type UpdateRetentionsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Retentions []*Retention `protobuf:"bytes,1,rep,name=retentions,proto3" json:"retentions,omitempty"` +} + +func (x *UpdateRetentionsResponse) Reset() { + *x = UpdateRetentionsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateRetentionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRetentionsResponse) ProtoMessage() {} + +func (x *UpdateRetentionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateRetentionsResponse.ProtoReflect.Descriptor instead. +func (*UpdateRetentionsResponse) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v1_retentions_service_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateRetentionsResponse) GetRetentions() []*Retention { + if x != nil { + return x.Retentions + } + return nil +} + +type ActivateRetentionsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ActivateRetentionsRequest) Reset() { + *x = ActivateRetentionsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivateRetentionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivateRetentionsRequest) ProtoMessage() {} + +func (x *ActivateRetentionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[5] + 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 ActivateRetentionsRequest.ProtoReflect.Descriptor instead. +func (*ActivateRetentionsRequest) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v1_retentions_service_proto_rawDescGZIP(), []int{5} +} + +type ActivateRetentionsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ActivateRetentions *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=activate_retentions,json=activateRetentions,proto3" json:"activate_retentions,omitempty"` +} + +func (x *ActivateRetentionsResponse) Reset() { + *x = ActivateRetentionsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivateRetentionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivateRetentionsResponse) ProtoMessage() {} + +func (x *ActivateRetentionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[6] + 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 ActivateRetentionsResponse.ProtoReflect.Descriptor instead. +func (*ActivateRetentionsResponse) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v1_retentions_service_proto_rawDescGZIP(), []int{6} +} + +func (x *ActivateRetentionsResponse) GetActivateRetentions() *wrapperspb.BoolValue { + if x != nil { + return x.ActivateRetentions + } + return nil +} + +type GetRetentionsEnabledRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetRetentionsEnabledRequest) Reset() { + *x = GetRetentionsEnabledRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRetentionsEnabledRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRetentionsEnabledRequest) ProtoMessage() {} + +func (x *GetRetentionsEnabledRequest) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[7] + 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 GetRetentionsEnabledRequest.ProtoReflect.Descriptor instead. +func (*GetRetentionsEnabledRequest) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v1_retentions_service_proto_rawDescGZIP(), []int{7} +} + +type GetRetentionsEnabledResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EnableTags *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=enable_tags,json=enableTags,proto3" json:"enable_tags,omitempty"` +} + +func (x *GetRetentionsEnabledResponse) Reset() { + *x = GetRetentionsEnabledResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRetentionsEnabledResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRetentionsEnabledResponse) ProtoMessage() {} + +func (x *GetRetentionsEnabledResponse) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[8] + 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 GetRetentionsEnabledResponse.ProtoReflect.Descriptor instead. +func (*GetRetentionsEnabledResponse) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v1_retentions_service_proto_rawDescGZIP(), []int{8} +} + +func (x *GetRetentionsEnabledResponse) GetEnableTags() *wrapperspb.BoolValue { + if x != nil { + return x.EnableTags + } + return nil +} + +var file_com_coralogix_archive_v1_retentions_service_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 65001, + Name: "com.coralogix.archive.v1.validation_pattern", + Tag: "bytes,65001,opt,name=validation_pattern", + Filename: "com/coralogix/archive/v1/retentions_service.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*int32)(nil), + Field: 65002, + Name: "com.coralogix.archive.v1.validation_max_length", + Tag: "varint,65002,opt,name=validation_max_length", + Filename: "com/coralogix/archive/v1/retentions_service.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 65003, + Name: "com.coralogix.archive.v1.validation_encoding", + Tag: "bytes,65003,opt,name=validation_encoding", + Filename: "com/coralogix/archive/v1/retentions_service.proto", + }, + { + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*int32)(nil), + Field: 65004, + Name: "com.coralogix.archive.v1.validation_max_elements", + Tag: "varint,65004,opt,name=validation_max_elements", + Filename: "com/coralogix/archive/v1/retentions_service.proto", + }, +} + +// Extension fields to descriptorpb.FieldOptions. +var ( + // optional string validation_pattern = 65001; + E_ValidationPattern = &file_com_coralogix_archive_v1_retentions_service_proto_extTypes[0] + // optional int32 validation_max_length = 65002; + E_ValidationMaxLength = &file_com_coralogix_archive_v1_retentions_service_proto_extTypes[1] + // optional string validation_encoding = 65003; + E_ValidationEncoding = &file_com_coralogix_archive_v1_retentions_service_proto_extTypes[2] + // optional int32 validation_max_elements = 65004; + E_ValidationMaxElements = &file_com_coralogix_archive_v1_retentions_service_proto_extTypes[3] +) + +var File_com_coralogix_archive_v1_retentions_service_proto protoreflect.FileDescriptor + +var file_com_coralogix_archive_v1_retentions_service_proto_rawDesc = []byte{ + 0x0a, 0x31, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x74, 0x65, 0x6e, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, + 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x28, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x61, + 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x5f, + 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, + 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x16, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5c, 0x0a, 0x15, 0x47, + 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, + 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x72, + 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xfb, 0x01, 0x0a, 0x16, 0x52, 0x65, + 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x89, 0x01, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, + 0x5b, 0xca, 0xde, 0x1f, 0x57, 0x5e, 0x28, 0x5b, 0x61, 0x2d, 0x66, 0x41, 0x2d, 0x46, 0x30, 0x2d, + 0x39, 0x5d, 0x7b, 0x38, 0x7d, 0x5b, 0x2d, 0x5d, 0x5b, 0x61, 0x2d, 0x66, 0x41, 0x2d, 0x46, 0x30, + 0x2d, 0x39, 0x5d, 0x7b, 0x34, 0x7d, 0x5b, 0x2d, 0x5d, 0x5b, 0x61, 0x2d, 0x66, 0x41, 0x2d, 0x46, + 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x34, 0x7d, 0x5b, 0x2d, 0x5d, 0x5b, 0x61, 0x2d, 0x66, 0x41, 0x2d, + 0x46, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x34, 0x7d, 0x5b, 0x2d, 0x5d, 0x5b, 0x61, 0x2d, 0x66, 0x41, + 0x2d, 0x46, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x31, 0x32, 0x7d, 0x29, 0x24, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x55, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x23, 0xca, 0xde, + 0x1f, 0x10, 0x5e, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0x5f, 0x2d, 0x5d, + 0x2b, 0x24, 0xd0, 0xde, 0x1f, 0xff, 0x01, 0xda, 0xde, 0x1f, 0x06, 0x6c, 0x61, 0x74, 0x69, 0x6e, + 0x31, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x8d, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x72, 0x0a, 0x19, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, + 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x04, 0xe0, 0xde, 0x1f, 0x04, 0x52, 0x17, + 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x5f, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x72, 0x65, + 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x1b, 0x0a, 0x19, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x69, 0x0a, 0x1a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x13, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, + 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x12, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x22, 0x1d, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x5b, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3b, 0x0a, 0x0b, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x0a, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x61, 0x67, 0x73, 0x32, 0x88, 0x05, 0x0a, + 0x11, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x86, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, + 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, + 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0xc2, 0xb8, 0x02, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x74, + 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x97, 0x01, 0x0a, 0x10, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, + 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0xc2, 0xb8, 0x02, 0x18, 0x0a, 0x16, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x9e, 0x01, 0x0a, 0x12, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, + 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, + 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0xc2, 0xb8, 0x02, 0x19, 0x0a, 0x17, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x74, 0x61, 0x67, 0x73, 0x12, 0xae, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, 0x65, + 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, + 0x35, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, + 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, + 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, + 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, + 0xc2, 0xb8, 0x02, 0x23, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x61, 0x67, 0x73, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x4e, 0x0a, 0x12, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1d, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe9, 0xfb, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x3a, 0x53, 0x0a, 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, + 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0xea, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x50, 0x0a, 0x13, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, + 0x69, 0x6e, 0x67, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0xeb, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x57, + 0x0a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x78, + 0x5f, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xec, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x78, 0x45, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x03, 0x5a, 0x01, 0x2e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_archive_v1_retentions_service_proto_rawDescOnce sync.Once + file_com_coralogix_archive_v1_retentions_service_proto_rawDescData = file_com_coralogix_archive_v1_retentions_service_proto_rawDesc +) + +func file_com_coralogix_archive_v1_retentions_service_proto_rawDescGZIP() []byte { + file_com_coralogix_archive_v1_retentions_service_proto_rawDescOnce.Do(func() { + file_com_coralogix_archive_v1_retentions_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_archive_v1_retentions_service_proto_rawDescData) + }) + return file_com_coralogix_archive_v1_retentions_service_proto_rawDescData +} + +var file_com_coralogix_archive_v1_retentions_service_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_com_coralogix_archive_v1_retentions_service_proto_goTypes = []interface{}{ + (*GetRetentionsRequest)(nil), // 0: com.coralogix.archive.v1.GetRetentionsRequest + (*GetRetentionsResponse)(nil), // 1: com.coralogix.archive.v1.GetRetentionsResponse + (*RetentionUpdateElement)(nil), // 2: com.coralogix.archive.v1.RetentionUpdateElement + (*UpdateRetentionsRequest)(nil), // 3: com.coralogix.archive.v1.UpdateRetentionsRequest + (*UpdateRetentionsResponse)(nil), // 4: com.coralogix.archive.v1.UpdateRetentionsResponse + (*ActivateRetentionsRequest)(nil), // 5: com.coralogix.archive.v1.ActivateRetentionsRequest + (*ActivateRetentionsResponse)(nil), // 6: com.coralogix.archive.v1.ActivateRetentionsResponse + (*GetRetentionsEnabledRequest)(nil), // 7: com.coralogix.archive.v1.GetRetentionsEnabledRequest + (*GetRetentionsEnabledResponse)(nil), // 8: com.coralogix.archive.v1.GetRetentionsEnabledResponse + (*Retention)(nil), // 9: com.coralogix.archive.v1.Retention + (*wrapperspb.StringValue)(nil), // 10: google.protobuf.StringValue + (*wrapperspb.BoolValue)(nil), // 11: google.protobuf.BoolValue + (*descriptorpb.FieldOptions)(nil), // 12: google.protobuf.FieldOptions +} +var file_com_coralogix_archive_v1_retentions_service_proto_depIdxs = []int32{ + 9, // 0: com.coralogix.archive.v1.GetRetentionsResponse.retentions:type_name -> com.coralogix.archive.v1.Retention + 10, // 1: com.coralogix.archive.v1.RetentionUpdateElement.id:type_name -> google.protobuf.StringValue + 10, // 2: com.coralogix.archive.v1.RetentionUpdateElement.name:type_name -> google.protobuf.StringValue + 2, // 3: com.coralogix.archive.v1.UpdateRetentionsRequest.retention_update_elements:type_name -> com.coralogix.archive.v1.RetentionUpdateElement + 9, // 4: com.coralogix.archive.v1.UpdateRetentionsResponse.retentions:type_name -> com.coralogix.archive.v1.Retention + 11, // 5: com.coralogix.archive.v1.ActivateRetentionsResponse.activate_retentions:type_name -> google.protobuf.BoolValue + 11, // 6: com.coralogix.archive.v1.GetRetentionsEnabledResponse.enable_tags:type_name -> google.protobuf.BoolValue + 12, // 7: com.coralogix.archive.v1.validation_pattern:extendee -> google.protobuf.FieldOptions + 12, // 8: com.coralogix.archive.v1.validation_max_length:extendee -> google.protobuf.FieldOptions + 12, // 9: com.coralogix.archive.v1.validation_encoding:extendee -> google.protobuf.FieldOptions + 12, // 10: com.coralogix.archive.v1.validation_max_elements:extendee -> google.protobuf.FieldOptions + 0, // 11: com.coralogix.archive.v1.RetentionsService.GetRetentions:input_type -> com.coralogix.archive.v1.GetRetentionsRequest + 3, // 12: com.coralogix.archive.v1.RetentionsService.UpdateRetentions:input_type -> com.coralogix.archive.v1.UpdateRetentionsRequest + 5, // 13: com.coralogix.archive.v1.RetentionsService.ActivateRetentions:input_type -> com.coralogix.archive.v1.ActivateRetentionsRequest + 7, // 14: com.coralogix.archive.v1.RetentionsService.GetRetentionsEnabled:input_type -> com.coralogix.archive.v1.GetRetentionsEnabledRequest + 1, // 15: com.coralogix.archive.v1.RetentionsService.GetRetentions:output_type -> com.coralogix.archive.v1.GetRetentionsResponse + 4, // 16: com.coralogix.archive.v1.RetentionsService.UpdateRetentions:output_type -> com.coralogix.archive.v1.UpdateRetentionsResponse + 6, // 17: com.coralogix.archive.v1.RetentionsService.ActivateRetentions:output_type -> com.coralogix.archive.v1.ActivateRetentionsResponse + 8, // 18: com.coralogix.archive.v1.RetentionsService.GetRetentionsEnabled:output_type -> com.coralogix.archive.v1.GetRetentionsEnabledResponse + 15, // [15:19] is the sub-list for method output_type + 11, // [11:15] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 7, // [7:11] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_com_coralogix_archive_v1_retentions_service_proto_init() } +func file_com_coralogix_archive_v1_retentions_service_proto_init() { + if File_com_coralogix_archive_v1_retentions_service_proto != nil { + return + } + //file_com_coralogix_archive_v1_audit_log_proto_init() + file_com_coralogix_archive_v1_retention_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRetentionsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRetentionsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RetentionUpdateElement); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateRetentionsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateRetentionsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActivateRetentionsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActivateRetentionsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRetentionsEnabledRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_com_coralogix_archive_v1_retentions_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRetentionsEnabledResponse); 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_com_coralogix_archive_v1_retentions_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 4, + NumServices: 1, + }, + GoTypes: file_com_coralogix_archive_v1_retentions_service_proto_goTypes, + DependencyIndexes: file_com_coralogix_archive_v1_retentions_service_proto_depIdxs, + MessageInfos: file_com_coralogix_archive_v1_retentions_service_proto_msgTypes, + ExtensionInfos: file_com_coralogix_archive_v1_retentions_service_proto_extTypes, + }.Build() + File_com_coralogix_archive_v1_retentions_service_proto = out.File + file_com_coralogix_archive_v1_retentions_service_proto_rawDesc = nil + file_com_coralogix_archive_v1_retentions_service_proto_goTypes = nil + file_com_coralogix_archive_v1_retentions_service_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/archive-retentions/retentions_service_grpc.pb.go b/coralogix/clientset/grpc/archive-retentions/retentions_service_grpc.pb.go new file mode 100644 index 00000000..db52b4c6 --- /dev/null +++ b/coralogix/clientset/grpc/archive-retentions/retentions_service_grpc.pb.go @@ -0,0 +1,213 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.8 +// source: com/coralogix/archive/v1/retentions_service.proto + +package __ + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// RetentionsServiceClient is the client API for RetentionsService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type RetentionsServiceClient interface { + GetRetentions(ctx context.Context, in *GetRetentionsRequest, opts ...grpc.CallOption) (*GetRetentionsResponse, error) + UpdateRetentions(ctx context.Context, in *UpdateRetentionsRequest, opts ...grpc.CallOption) (*UpdateRetentionsResponse, error) + ActivateRetentions(ctx context.Context, in *ActivateRetentionsRequest, opts ...grpc.CallOption) (*ActivateRetentionsResponse, error) + GetRetentionsEnabled(ctx context.Context, in *GetRetentionsEnabledRequest, opts ...grpc.CallOption) (*GetRetentionsEnabledResponse, error) +} + +type retentionsServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRetentionsServiceClient(cc grpc.ClientConnInterface) RetentionsServiceClient { + return &retentionsServiceClient{cc} +} + +func (c *retentionsServiceClient) GetRetentions(ctx context.Context, in *GetRetentionsRequest, opts ...grpc.CallOption) (*GetRetentionsResponse, error) { + out := new(GetRetentionsResponse) + err := c.cc.Invoke(ctx, "/com.coralogix.archive.v1.RetentionsService/GetRetentions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *retentionsServiceClient) UpdateRetentions(ctx context.Context, in *UpdateRetentionsRequest, opts ...grpc.CallOption) (*UpdateRetentionsResponse, error) { + out := new(UpdateRetentionsResponse) + err := c.cc.Invoke(ctx, "/com.coralogix.archive.v1.RetentionsService/UpdateRetentions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *retentionsServiceClient) ActivateRetentions(ctx context.Context, in *ActivateRetentionsRequest, opts ...grpc.CallOption) (*ActivateRetentionsResponse, error) { + out := new(ActivateRetentionsResponse) + err := c.cc.Invoke(ctx, "/com.coralogix.archive.v1.RetentionsService/ActivateRetentions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *retentionsServiceClient) GetRetentionsEnabled(ctx context.Context, in *GetRetentionsEnabledRequest, opts ...grpc.CallOption) (*GetRetentionsEnabledResponse, error) { + out := new(GetRetentionsEnabledResponse) + err := c.cc.Invoke(ctx, "/com.coralogix.archive.v1.RetentionsService/GetRetentionsEnabled", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RetentionsServiceServer is the server API for RetentionsService service. +// All implementations must embed UnimplementedRetentionsServiceServer +// for forward compatibility +type RetentionsServiceServer interface { + GetRetentions(context.Context, *GetRetentionsRequest) (*GetRetentionsResponse, error) + UpdateRetentions(context.Context, *UpdateRetentionsRequest) (*UpdateRetentionsResponse, error) + ActivateRetentions(context.Context, *ActivateRetentionsRequest) (*ActivateRetentionsResponse, error) + GetRetentionsEnabled(context.Context, *GetRetentionsEnabledRequest) (*GetRetentionsEnabledResponse, error) + mustEmbedUnimplementedRetentionsServiceServer() +} + +// UnimplementedRetentionsServiceServer must be embedded to have forward compatible implementations. +type UnimplementedRetentionsServiceServer struct { +} + +func (UnimplementedRetentionsServiceServer) GetRetentions(context.Context, *GetRetentionsRequest) (*GetRetentionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRetentions not implemented") +} +func (UnimplementedRetentionsServiceServer) UpdateRetentions(context.Context, *UpdateRetentionsRequest) (*UpdateRetentionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateRetentions not implemented") +} +func (UnimplementedRetentionsServiceServer) ActivateRetentions(context.Context, *ActivateRetentionsRequest) (*ActivateRetentionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ActivateRetentions not implemented") +} +func (UnimplementedRetentionsServiceServer) GetRetentionsEnabled(context.Context, *GetRetentionsEnabledRequest) (*GetRetentionsEnabledResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRetentionsEnabled not implemented") +} +func (UnimplementedRetentionsServiceServer) mustEmbedUnimplementedRetentionsServiceServer() {} + +// UnsafeRetentionsServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RetentionsServiceServer will +// result in compilation errors. +type UnsafeRetentionsServiceServer interface { + mustEmbedUnimplementedRetentionsServiceServer() +} + +func RegisterRetentionsServiceServer(s grpc.ServiceRegistrar, srv RetentionsServiceServer) { + s.RegisterService(&RetentionsService_ServiceDesc, srv) +} + +func _RetentionsService_GetRetentions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRetentionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RetentionsServiceServer).GetRetentions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.coralogix.archive.v1.RetentionsService/GetRetentions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RetentionsServiceServer).GetRetentions(ctx, req.(*GetRetentionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RetentionsService_UpdateRetentions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateRetentionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RetentionsServiceServer).UpdateRetentions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.coralogix.archive.v1.RetentionsService/UpdateRetentions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RetentionsServiceServer).UpdateRetentions(ctx, req.(*UpdateRetentionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RetentionsService_ActivateRetentions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ActivateRetentionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RetentionsServiceServer).ActivateRetentions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.coralogix.archive.v1.RetentionsService/ActivateRetentions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RetentionsServiceServer).ActivateRetentions(ctx, req.(*ActivateRetentionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RetentionsService_GetRetentionsEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRetentionsEnabledRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RetentionsServiceServer).GetRetentionsEnabled(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.coralogix.archive.v1.RetentionsService/GetRetentionsEnabled", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RetentionsServiceServer).GetRetentionsEnabled(ctx, req.(*GetRetentionsEnabledRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// RetentionsService_ServiceDesc is the grpc.ServiceDesc for RetentionsService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RetentionsService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "com.coralogix.archive.v1.RetentionsService", + HandlerType: (*RetentionsServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetRetentions", + Handler: _RetentionsService_GetRetentions_Handler, + }, + { + MethodName: "UpdateRetentions", + Handler: _RetentionsService_UpdateRetentions_Handler, + }, + { + MethodName: "ActivateRetentions", + Handler: _RetentionsService_ActivateRetentions_Handler, + }, + { + MethodName: "GetRetentionsEnabled", + Handler: _RetentionsService_GetRetentionsEnabled_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "com/coralogix/archive/v1/retentions_service.proto", +} diff --git a/coralogix/clientset/grpc/archive-setup/target.pb.go b/coralogix/clientset/grpc/archive-setup/target.pb.go new file mode 100644 index 00000000..58bace7f --- /dev/null +++ b/coralogix/clientset/grpc/archive-setup/target.pb.go @@ -0,0 +1,434 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/archive/v2/target.proto + +package __ + +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 IBMCosTargetSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Crn string `protobuf:"bytes,1,opt,name=crn,proto3" json:"crn,omitempty"` + Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` +} + +func (x *IBMCosTargetSpec) Reset() { + *x = IBMCosTargetSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v2_target_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IBMCosTargetSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IBMCosTargetSpec) ProtoMessage() {} + +func (x *IBMCosTargetSpec) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v2_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 IBMCosTargetSpec.ProtoReflect.Descriptor instead. +func (*IBMCosTargetSpec) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v2_target_proto_rawDescGZIP(), []int{0} +} + +func (x *IBMCosTargetSpec) GetCrn() string { + if x != nil { + return x.Crn + } + return "" +} + +func (x *IBMCosTargetSpec) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +type S3TargetSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Bucket string `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` + Region *string `protobuf:"bytes,2,opt,name=region,proto3,oneof" json:"region,omitempty"` +} + +func (x *S3TargetSpec) Reset() { + *x = S3TargetSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v2_target_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *S3TargetSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*S3TargetSpec) ProtoMessage() {} + +func (x *S3TargetSpec) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v2_target_proto_msgTypes[1] + 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 S3TargetSpec.ProtoReflect.Descriptor instead. +func (*S3TargetSpec) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v2_target_proto_rawDescGZIP(), []int{1} +} + +func (x *S3TargetSpec) GetBucket() string { + if x != nil { + return x.Bucket + } + return "" +} + +func (x *S3TargetSpec) GetRegion() string { + if x != nil && x.Region != nil { + return *x.Region + } + return "" +} + +type ArchiveSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ArchivingFormatId string `protobuf:"bytes,1,opt,name=archiving_format_id,json=archivingFormatId,proto3" json:"archiving_format_id,omitempty"` + IsActive bool `protobuf:"varint,2,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"` + EnableTags bool `protobuf:"varint,3,opt,name=enable_tags,json=enableTags,proto3" json:"enable_tags,omitempty"` +} + +func (x *ArchiveSpec) Reset() { + *x = ArchiveSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v2_target_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArchiveSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArchiveSpec) ProtoMessage() {} + +func (x *ArchiveSpec) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v2_target_proto_msgTypes[2] + 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 ArchiveSpec.ProtoReflect.Descriptor instead. +func (*ArchiveSpec) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v2_target_proto_rawDescGZIP(), []int{2} +} + +func (x *ArchiveSpec) GetArchivingFormatId() string { + if x != nil { + return x.ArchivingFormatId + } + return "" +} + +func (x *ArchiveSpec) GetIsActive() bool { + if x != nil { + return x.IsActive + } + return false +} + +func (x *ArchiveSpec) GetEnableTags() bool { + if x != nil { + return x.EnableTags + } + return false +} + +type Target struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to TargetSpec: + // *Target_S3 + // *Target_IbmCos + TargetSpec isTarget_TargetSpec `protobuf_oneof:"target_spec"` + ArchiveSpec *ArchiveSpec `protobuf:"bytes,3,opt,name=archive_spec,json=archiveSpec,proto3" json:"archive_spec,omitempty"` +} + +func (x *Target) Reset() { + *x = Target{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v2_target_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Target) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Target) ProtoMessage() {} + +func (x *Target) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v2_target_proto_msgTypes[3] + 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 Target.ProtoReflect.Descriptor instead. +func (*Target) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v2_target_proto_rawDescGZIP(), []int{3} +} + +func (m *Target) GetTargetSpec() isTarget_TargetSpec { + if m != nil { + return m.TargetSpec + } + return nil +} + +func (x *Target) GetS3() *S3TargetSpec { + if x, ok := x.GetTargetSpec().(*Target_S3); ok { + return x.S3 + } + return nil +} + +func (x *Target) GetIbmCos() *IBMCosTargetSpec { + if x, ok := x.GetTargetSpec().(*Target_IbmCos); ok { + return x.IbmCos + } + return nil +} + +func (x *Target) GetArchiveSpec() *ArchiveSpec { + if x != nil { + return x.ArchiveSpec + } + return nil +} + +type isTarget_TargetSpec interface { + isTarget_TargetSpec() +} + +type Target_S3 struct { + S3 *S3TargetSpec `protobuf:"bytes,1,opt,name=s3,proto3,oneof"` +} + +type Target_IbmCos struct { + IbmCos *IBMCosTargetSpec `protobuf:"bytes,2,opt,name=ibm_cos,json=ibmCos,proto3,oneof"` +} + +func (*Target_S3) isTarget_TargetSpec() {} + +func (*Target_IbmCos) isTarget_TargetSpec() {} + +var File_com_coralogix_archive_v2_target_proto protoreflect.FileDescriptor + +var file_com_coralogix_archive_v2_target_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, + 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, + 0x32, 0x22, 0x40, 0x0a, 0x10, 0x49, 0x42, 0x4d, 0x43, 0x6f, 0x73, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x72, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x63, 0x72, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x22, 0x4e, 0x0a, 0x0c, 0x53, 0x33, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, + 0x70, 0x65, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x72, + 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x72, + 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x72, 0x65, 0x67, + 0x69, 0x6f, 0x6e, 0x22, 0x7b, 0x0a, 0x0b, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x53, 0x70, + 0x65, 0x63, 0x12, 0x2e, 0x0a, 0x13, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x69, 0x6e, 0x67, 0x5f, + 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x11, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, + 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x61, 0x67, 0x73, + 0x22, 0xe2, 0x01, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x38, 0x0a, 0x02, 0x73, + 0x33, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x53, 0x33, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x70, 0x65, 0x63, 0x48, + 0x00, 0x52, 0x02, 0x73, 0x33, 0x12, 0x45, 0x0a, 0x07, 0x69, 0x62, 0x6d, 0x5f, 0x63, 0x6f, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, + 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x49, 0x42, 0x4d, 0x43, 0x6f, 0x73, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x70, + 0x65, 0x63, 0x48, 0x00, 0x52, 0x06, 0x69, 0x62, 0x6d, 0x43, 0x6f, 0x73, 0x12, 0x48, 0x0a, 0x0c, + 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x72, + 0x63, 0x68, 0x69, 0x76, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x0b, 0x61, 0x72, 0x63, 0x68, 0x69, + 0x76, 0x65, 0x53, 0x70, 0x65, 0x63, 0x42, 0x0d, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x73, 0x70, 0x65, 0x63, 0x42, 0x03, 0x5a, 0x01, 0x2e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_com_coralogix_archive_v2_target_proto_rawDescOnce sync.Once + file_com_coralogix_archive_v2_target_proto_rawDescData = file_com_coralogix_archive_v2_target_proto_rawDesc +) + +func file_com_coralogix_archive_v2_target_proto_rawDescGZIP() []byte { + file_com_coralogix_archive_v2_target_proto_rawDescOnce.Do(func() { + file_com_coralogix_archive_v2_target_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_archive_v2_target_proto_rawDescData) + }) + return file_com_coralogix_archive_v2_target_proto_rawDescData +} + +var file_com_coralogix_archive_v2_target_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_com_coralogix_archive_v2_target_proto_goTypes = []interface{}{ + (*IBMCosTargetSpec)(nil), // 0: com.coralogix.archive.v2.IBMCosTargetSpec + (*S3TargetSpec)(nil), // 1: com.coralogix.archive.v2.S3TargetSpec + (*ArchiveSpec)(nil), // 2: com.coralogix.archive.v2.ArchiveSpec + (*Target)(nil), // 3: com.coralogix.archive.v2.Target +} +var file_com_coralogix_archive_v2_target_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.archive.v2.Target.s3:type_name -> com.coralogix.archive.v2.S3TargetSpec + 0, // 1: com.coralogix.archive.v2.Target.ibm_cos:type_name -> com.coralogix.archive.v2.IBMCosTargetSpec + 2, // 2: com.coralogix.archive.v2.Target.archive_spec:type_name -> com.coralogix.archive.v2.ArchiveSpec + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_com_coralogix_archive_v2_target_proto_init() } +func file_com_coralogix_archive_v2_target_proto_init() { + if File_com_coralogix_archive_v2_target_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_com_coralogix_archive_v2_target_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IBMCosTargetSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_com_coralogix_archive_v2_target_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*S3TargetSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_com_coralogix_archive_v2_target_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ArchiveSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_com_coralogix_archive_v2_target_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Target); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_com_coralogix_archive_v2_target_proto_msgTypes[1].OneofWrappers = []interface{}{} + file_com_coralogix_archive_v2_target_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*Target_S3)(nil), + (*Target_IbmCos)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_com_coralogix_archive_v2_target_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_archive_v2_target_proto_goTypes, + DependencyIndexes: file_com_coralogix_archive_v2_target_proto_depIdxs, + MessageInfos: file_com_coralogix_archive_v2_target_proto_msgTypes, + }.Build() + File_com_coralogix_archive_v2_target_proto = out.File + file_com_coralogix_archive_v2_target_proto_rawDesc = nil + file_com_coralogix_archive_v2_target_proto_goTypes = nil + file_com_coralogix_archive_v2_target_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/archive-setup/target_service.pb.go b/coralogix/clientset/grpc/archive-setup/target_service.pb.go new file mode 100644 index 00000000..8806c69c --- /dev/null +++ b/coralogix/clientset/grpc/archive-setup/target_service.pb.go @@ -0,0 +1,415 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/archive/v2/target_service.proto + +package __ + +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 GetTargetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetTargetRequest) Reset() { + *x = GetTargetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v2_target_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTargetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTargetRequest) ProtoMessage() {} + +func (x *GetTargetRequest) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v2_target_service_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 GetTargetRequest.ProtoReflect.Descriptor instead. +func (*GetTargetRequest) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v2_target_service_proto_rawDescGZIP(), []int{0} +} + +type GetTargetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Target *Target `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` +} + +func (x *GetTargetResponse) Reset() { + *x = GetTargetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v2_target_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTargetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTargetResponse) ProtoMessage() {} + +func (x *GetTargetResponse) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v2_target_service_proto_msgTypes[1] + 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 GetTargetResponse.ProtoReflect.Descriptor instead. +func (*GetTargetResponse) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v2_target_service_proto_rawDescGZIP(), []int{1} +} + +func (x *GetTargetResponse) GetTarget() *Target { + if x != nil { + return x.Target + } + return nil +} + +type SetTargetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsActive bool `protobuf:"varint,1,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"` + // Types that are assignable to TargetSpec: + // *SetTargetRequest_S3 + // *SetTargetRequest_IbmCos + TargetSpec isSetTargetRequest_TargetSpec `protobuf_oneof:"target_spec"` +} + +func (x *SetTargetRequest) Reset() { + *x = SetTargetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v2_target_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetTargetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetTargetRequest) ProtoMessage() {} + +func (x *SetTargetRequest) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v2_target_service_proto_msgTypes[2] + 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 SetTargetRequest.ProtoReflect.Descriptor instead. +func (*SetTargetRequest) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v2_target_service_proto_rawDescGZIP(), []int{2} +} + +func (x *SetTargetRequest) GetIsActive() bool { + if x != nil { + return x.IsActive + } + return false +} + +func (m *SetTargetRequest) GetTargetSpec() isSetTargetRequest_TargetSpec { + if m != nil { + return m.TargetSpec + } + return nil +} + +func (x *SetTargetRequest) GetS3() *S3TargetSpec { + if x, ok := x.GetTargetSpec().(*SetTargetRequest_S3); ok { + return x.S3 + } + return nil +} + +func (x *SetTargetRequest) GetIbmCos() *IBMCosTargetSpec { + if x, ok := x.GetTargetSpec().(*SetTargetRequest_IbmCos); ok { + return x.IbmCos + } + return nil +} + +type isSetTargetRequest_TargetSpec interface { + isSetTargetRequest_TargetSpec() +} + +type SetTargetRequest_S3 struct { + S3 *S3TargetSpec `protobuf:"bytes,2,opt,name=s3,proto3,oneof"` +} + +type SetTargetRequest_IbmCos struct { + IbmCos *IBMCosTargetSpec `protobuf:"bytes,3,opt,name=ibm_cos,json=ibmCos,proto3,oneof"` +} + +func (*SetTargetRequest_S3) isSetTargetRequest_TargetSpec() {} + +func (*SetTargetRequest_IbmCos) isSetTargetRequest_TargetSpec() {} + +type SetTargetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Target *Target `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` +} + +func (x *SetTargetResponse) Reset() { + *x = SetTargetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_archive_v2_target_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetTargetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetTargetResponse) ProtoMessage() {} + +func (x *SetTargetResponse) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_archive_v2_target_service_proto_msgTypes[3] + 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 SetTargetResponse.ProtoReflect.Descriptor instead. +func (*SetTargetResponse) Descriptor() ([]byte, []int) { + return file_com_coralogix_archive_v2_target_service_proto_rawDescGZIP(), []int{3} +} + +func (x *SetTargetResponse) GetTarget() *Target { + if x != nil { + return x.Target + } + return nil +} + +var File_com_coralogix_archive_v2_target_service_proto protoreflect.FileDescriptor + +var file_com_coralogix_archive_v2_target_service_proto_rawDesc = []byte{ + 0x0a, 0x2d, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, + 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, 0x32, 0x1a, 0x28, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, + 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x12, 0x0a, 0x10, 0x47, 0x65, + 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4d, + 0x0a, 0x11, 0x47, 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0xbf, 0x01, + 0x0a, 0x10, 0x53, 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, + 0x38, 0x0a, 0x02, 0x73, 0x33, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, + 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, + 0x69, 0x76, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x33, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, + 0x70, 0x65, 0x63, 0x48, 0x00, 0x52, 0x02, 0x73, 0x33, 0x12, 0x45, 0x0a, 0x07, 0x69, 0x62, 0x6d, + 0x5f, 0x63, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, + 0x76, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x42, 0x4d, 0x43, 0x6f, 0x73, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x53, 0x70, 0x65, 0x63, 0x48, 0x00, 0x52, 0x06, 0x69, 0x62, 0x6d, 0x43, 0x6f, 0x73, + 0x42, 0x0d, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x22, + 0x4d, 0x0a, 0x11, 0x53, 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, + 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x32, 0xff, + 0x01, 0x0a, 0x0d, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x76, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2a, 0x2e, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, + 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x10, 0xc2, 0xb8, 0x02, 0x0c, 0x0a, 0x0a, 0x47, 0x65, + 0x74, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x76, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, + 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x53, 0x65, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, + 0x78, 0x2e, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x10, + 0xc2, 0xb8, 0x02, 0x0c, 0x0a, 0x0a, 0x53, 0x65, 0x74, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x42, 0x03, 0x5a, 0x01, 0x2e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_archive_v2_target_service_proto_rawDescOnce sync.Once + file_com_coralogix_archive_v2_target_service_proto_rawDescData = file_com_coralogix_archive_v2_target_service_proto_rawDesc +) + +func file_com_coralogix_archive_v2_target_service_proto_rawDescGZIP() []byte { + file_com_coralogix_archive_v2_target_service_proto_rawDescOnce.Do(func() { + file_com_coralogix_archive_v2_target_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_archive_v2_target_service_proto_rawDescData) + }) + return file_com_coralogix_archive_v2_target_service_proto_rawDescData +} + +var file_com_coralogix_archive_v2_target_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_com_coralogix_archive_v2_target_service_proto_goTypes = []interface{}{ + (*GetTargetRequest)(nil), // 0: com.coralogix.archive.v2.GetTargetRequest + (*GetTargetResponse)(nil), // 1: com.coralogix.archive.v2.GetTargetResponse + (*SetTargetRequest)(nil), // 2: com.coralogix.archive.v2.SetTargetRequest + (*SetTargetResponse)(nil), // 3: com.coralogix.archive.v2.SetTargetResponse + (*Target)(nil), // 4: com.coralogix.archive.v2.Target + (*S3TargetSpec)(nil), // 5: com.coralogix.archive.v2.S3TargetSpec + (*IBMCosTargetSpec)(nil), // 6: com.coralogix.archive.v2.IBMCosTargetSpec +} +var file_com_coralogix_archive_v2_target_service_proto_depIdxs = []int32{ + 4, // 0: com.coralogix.archive.v2.GetTargetResponse.target:type_name -> com.coralogix.archive.v2.Target + 5, // 1: com.coralogix.archive.v2.SetTargetRequest.s3:type_name -> com.coralogix.archive.v2.S3TargetSpec + 6, // 2: com.coralogix.archive.v2.SetTargetRequest.ibm_cos:type_name -> com.coralogix.archive.v2.IBMCosTargetSpec + 4, // 3: com.coralogix.archive.v2.SetTargetResponse.target:type_name -> com.coralogix.archive.v2.Target + 0, // 4: com.coralogix.archive.v2.TargetService.GetTarget:input_type -> com.coralogix.archive.v2.GetTargetRequest + 2, // 5: com.coralogix.archive.v2.TargetService.SetTarget:input_type -> com.coralogix.archive.v2.SetTargetRequest + 1, // 6: com.coralogix.archive.v2.TargetService.GetTarget:output_type -> com.coralogix.archive.v2.GetTargetResponse + 3, // 7: com.coralogix.archive.v2.TargetService.SetTarget:output_type -> com.coralogix.archive.v2.SetTargetResponse + 6, // [6:8] is the sub-list for method output_type + 4, // [4:6] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_com_coralogix_archive_v2_target_service_proto_init() } +func file_com_coralogix_archive_v2_target_service_proto_init() { + if File_com_coralogix_archive_v2_target_service_proto != nil { + return + } + //file_com_coralogix_archive_v1_audit_log_proto_init() + file_com_coralogix_archive_v2_target_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_archive_v2_target_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTargetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_com_coralogix_archive_v2_target_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTargetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_com_coralogix_archive_v2_target_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetTargetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_com_coralogix_archive_v2_target_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetTargetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_com_coralogix_archive_v2_target_service_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*SetTargetRequest_S3)(nil), + (*SetTargetRequest_IbmCos)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_com_coralogix_archive_v2_target_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_com_coralogix_archive_v2_target_service_proto_goTypes, + DependencyIndexes: file_com_coralogix_archive_v2_target_service_proto_depIdxs, + MessageInfos: file_com_coralogix_archive_v2_target_service_proto_msgTypes, + }.Build() + File_com_coralogix_archive_v2_target_service_proto = out.File + file_com_coralogix_archive_v2_target_service_proto_rawDesc = nil + file_com_coralogix_archive_v2_target_service_proto_goTypes = nil + file_com_coralogix_archive_v2_target_service_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/archive-setup/target_service_grpc.pb.go b/coralogix/clientset/grpc/archive-setup/target_service_grpc.pb.go new file mode 100644 index 00000000..bfeb11b1 --- /dev/null +++ b/coralogix/clientset/grpc/archive-setup/target_service_grpc.pb.go @@ -0,0 +1,141 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.8 +// source: com/coralogix/archive/v2/target_service.proto + +package __ + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// TargetServiceClient is the client API for TargetService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type TargetServiceClient interface { + GetTarget(ctx context.Context, in *GetTargetRequest, opts ...grpc.CallOption) (*GetTargetResponse, error) + SetTarget(ctx context.Context, in *SetTargetRequest, opts ...grpc.CallOption) (*SetTargetResponse, error) +} + +type targetServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewTargetServiceClient(cc grpc.ClientConnInterface) TargetServiceClient { + return &targetServiceClient{cc} +} + +func (c *targetServiceClient) GetTarget(ctx context.Context, in *GetTargetRequest, opts ...grpc.CallOption) (*GetTargetResponse, error) { + out := new(GetTargetResponse) + err := c.cc.Invoke(ctx, "/com.coralogix.archive.v2.TargetService/GetTarget", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *targetServiceClient) SetTarget(ctx context.Context, in *SetTargetRequest, opts ...grpc.CallOption) (*SetTargetResponse, error) { + out := new(SetTargetResponse) + err := c.cc.Invoke(ctx, "/com.coralogix.archive.v2.TargetService/SetTarget", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TargetServiceServer is the server API for TargetService service. +// All implementations must embed UnimplementedTargetServiceServer +// for forward compatibility +type TargetServiceServer interface { + GetTarget(context.Context, *GetTargetRequest) (*GetTargetResponse, error) + SetTarget(context.Context, *SetTargetRequest) (*SetTargetResponse, error) + mustEmbedUnimplementedTargetServiceServer() +} + +// UnimplementedTargetServiceServer must be embedded to have forward compatible implementations. +type UnimplementedTargetServiceServer struct { +} + +func (UnimplementedTargetServiceServer) GetTarget(context.Context, *GetTargetRequest) (*GetTargetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTarget not implemented") +} +func (UnimplementedTargetServiceServer) SetTarget(context.Context, *SetTargetRequest) (*SetTargetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetTarget not implemented") +} +func (UnimplementedTargetServiceServer) mustEmbedUnimplementedTargetServiceServer() {} + +// UnsafeTargetServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TargetServiceServer will +// result in compilation errors. +type UnsafeTargetServiceServer interface { + mustEmbedUnimplementedTargetServiceServer() +} + +func RegisterTargetServiceServer(s grpc.ServiceRegistrar, srv TargetServiceServer) { + s.RegisterService(&TargetService_ServiceDesc, srv) +} + +func _TargetService_GetTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTargetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TargetServiceServer).GetTarget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.coralogix.archive.v2.TargetService/GetTarget", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TargetServiceServer).GetTarget(ctx, req.(*GetTargetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TargetService_SetTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetTargetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TargetServiceServer).SetTarget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.coralogix.archive.v2.TargetService/SetTarget", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TargetServiceServer).SetTarget(ctx, req.(*SetTargetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// TargetService_ServiceDesc is the grpc.ServiceDesc for TargetService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var TargetService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "com.coralogix.archive.v2.TargetService", + HandlerType: (*TargetServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetTarget", + Handler: _TargetService_GetTarget_Handler, + }, + { + MethodName: "SetTarget", + Handler: _TargetService_SetTarget_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "com/coralogix/archive/v2/target_service.proto", +} diff --git a/coralogix/clientset/recording-rules-groups-sets-client.go b/coralogix/clientset/recording-rules-groups-sets-client.go index 4a19cd96..9f1238d9 100644 --- a/coralogix/clientset/recording-rules-groups-sets-client.go +++ b/coralogix/clientset/recording-rules-groups-sets-client.go @@ -22,7 +22,6 @@ func (r RecordingRulesGroupsSetsClient) CreateRecordingRuleGroupsSet(ctx context defer conn.Close() client := rrg.NewRuleGroupSetsClient(conn) - ctx = createAuthContext(ctx, r.callPropertiesCreator.apiKey) return client.Create(callProperties.Ctx, req, callProperties.CallOptions...) } @@ -75,7 +74,6 @@ func (r RecordingRulesGroupsSetsClient) ListRecordingRuleGroupsSets(ctx context. defer conn.Close() client := rrg.NewRuleGroupSetsClient(conn) - ctx = createAuthContext(ctx, r.callPropertiesCreator.apiKey) return client.List(callProperties.Ctx, &emptypb.Empty{}, callProperties.CallOptions...) } diff --git a/coralogix/data_source_coralogix_archive_retention.go b/coralogix/data_source_coralogix_archive_retention.go new file mode 100644 index 00000000..bb25d70f --- /dev/null +++ b/coralogix/data_source_coralogix_archive_retention.go @@ -0,0 +1,99 @@ +package coralogix + +import ( + "context" + "fmt" + "log" + + archiveRetention "terraform-provider-coralogix/coralogix/clientset/grpc/archive-retentions" + + datasourceschema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + resourceschema "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "google.golang.org/protobuf/encoding/protojson" + + "terraform-provider-coralogix/coralogix/clientset" + + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/resource" +) + +var _ datasource.DataSourceWithConfigure = &ArchiveRetentionsDataSource{} + +func NewArchiveRetentionsDataSource() datasource.DataSource { + return &ArchiveRetentionsDataSource{} +} + +type ArchiveRetentionsDataSource struct { + client *clientset.ArchiveRetentionsClient +} + +func (d *ArchiveRetentionsDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_archive_retentions" +} + +func (d *ArchiveRetentionsDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + clientSet, ok := req.ProviderData.(*clientset.ClientSet) + if !ok { + resp.Diagnostics.AddError( + "Unexpected Resource Configure Type", + fmt.Sprintf("Expected *clientset.ClientSet, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + return + } + + d.client = clientSet.ArchiveRetentions() +} + +func (d *ArchiveRetentionsDataSource) Schema(ctx context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + var r ArchiveRetentionsResource + var resourceResp resource.SchemaResponse + r.Schema(ctx, resource.SchemaRequest{}, &resourceResp) + + resp.Schema = convertSchema(resourceResp.Schema) +} + +func convertSchema(rs resourceschema.Schema) datasourceschema.Schema { + attributes := convertAttributes(rs.Attributes) + return datasourceschema.Schema{ + Attributes: attributes, + Description: rs.Description, + MarkdownDescription: rs.MarkdownDescription, + DeprecationMessage: rs.DeprecationMessage, + } +} + +func (d *ArchiveRetentionsDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data *ArchiveRetentionsResourceModel + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + if resp.Diagnostics.HasError() { + return + } + + //Get refreshed archive-retentions value from Coralogix + log.Print("[INFO] Reading archive-retentions:") + getArchiveRetentionsReq := &archiveRetention.GetRetentionsRequest{} + getArchiveRetentionsResp, err := d.client.GetRetentions(ctx, getArchiveRetentionsReq) + if err != nil { + log.Printf("[ERROR] Received error: %#v", err) + resp.Diagnostics.AddError( + "Error reading archive-retentions", + formatRpcErrors(err, getArchiveRetentionsURL, protojson.Format(getArchiveRetentionsReq)), + ) + + return + } + log.Printf("[INFO] Received archive-retentions: %s", protojson.Format(getArchiveRetentionsResp)) + + data, diags := flattenArchiveRetentions(ctx, getArchiveRetentionsResp.GetRetentions()) + if diags.HasError() { + resp.Diagnostics.Append(diags...) + return + } + + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) +} diff --git a/coralogix/data_source_coralogix_archive_retention_test.go b/coralogix/data_source_coralogix_archive_retention_test.go new file mode 100644 index 00000000..cf0ada0b --- /dev/null +++ b/coralogix/data_source_coralogix_archive_retention_test.go @@ -0,0 +1,31 @@ +package coralogix + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" +) + +var archiveRetentionsDataSourceName = "data." + archiveRetentionsResourceName + +func TestAccCoralogixDataSourceArchiveRetentions_basic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccCoralogixResourceArchiveRetentions() + + testAccCoralogixDataSourceArchiveRetentions_read(), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(archiveRetentionsDataSourceName, "retentions.#", "4"), + ), + }, + }, + }) +} + +func testAccCoralogixDataSourceArchiveRetentions_read() string { + return `data "coralogix_archive_retentions" "test" { +} +` +} diff --git a/coralogix/provider.go b/coralogix/provider.go index b8495730..b708ff3c 100644 --- a/coralogix/provider.go +++ b/coralogix/provider.go @@ -280,6 +280,7 @@ func (p *coralogixProvider) DataSources(context.Context) []func() datasource.Dat NewSLIDataSource, NewWebhookDataSource, NewRecordingRuleGroupSetDataSource, + NewArchiveRetentionsDataSource, } } @@ -293,5 +294,6 @@ func (p *coralogixProvider) Resources(context.Context) []func() resource.Resourc NewSLIResource, NewWebhookResource, NewRecordingRuleGroupSetResource, + NewArchiveRetentionsResource, } } diff --git a/coralogix/resource_coralogix_alert.go b/coralogix/resource_coralogix_alert.go index 2fc434f1..b7bee4fe 100644 --- a/coralogix/resource_coralogix_alert.go +++ b/coralogix/resource_coralogix_alert.go @@ -168,8 +168,8 @@ var ( alerts.EvaluationWindow_EVALUATION_WINDOW_DYNAMIC: "Dynamic", } validEvaluationWindow = []string{"Rolling", "Dynamic"} - getAlertURL = "com.coralogix.alerts.v2.AlertService/CreateAlert" - createAlertURL = "com.coralogix.alerts.v2.AlertService/GetAlertByUniqueId" + createAlertURL = "com.coralogix.alerts.v2.AlertService/CreateAlert" + getAlertURL = "com.coralogix.alerts.v2.AlertService/GetAlertByUniqueId" updateAlertURL = "com.coralogix.alerts.v2.AlertService/UpdateAlertByUniqueId" deleteAlertURL = "com.coralogix.alerts.v2.AlertService/DeleteAlertByUniqueId" ) @@ -1452,7 +1452,7 @@ func resourceCoralogixAlertCreate(ctx context.Context, d *schema.ResourceData, m if err != nil { log.Printf("[ERROR] Received error: %#v", err) - return diag.Errorf(formatRpcErrors(err, createAlertStr, createAlertStr)) + return diag.Errorf(formatRpcErrors(err, createAlertURL, createAlertStr)) } alert := AlertResp.GetAlert() @@ -1522,7 +1522,7 @@ func resourceCoralogixAlertDelete(ctx context.Context, d *schema.ResourceData, m _, err := meta.(*clientset.ClientSet).Alerts().DeleteAlert(ctx, deleteAlertRequest) if err != nil { log.Printf("[ERROR] Received error: %#v\n", err) - return diag.Errorf(formatRpcErrors(err, getAlertURL, protojson.Format(deleteAlertRequest))) + return diag.Errorf(formatRpcErrors(err, deleteAlertURL, protojson.Format(deleteAlertRequest))) } log.Printf("[INFO] alert %s deleted", id) diff --git a/coralogix/resource_coralogix_archive_retention.go b/coralogix/resource_coralogix_archive_retention.go new file mode 100644 index 00000000..ae66ac3b --- /dev/null +++ b/coralogix/resource_coralogix_archive_retention.go @@ -0,0 +1,402 @@ +package coralogix + +import ( + "context" + "fmt" + "log" + + "terraform-provider-coralogix/coralogix/clientset" + archiveRetention "terraform-provider-coralogix/coralogix/clientset/grpc/archive-retentions" + + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-framework/types/basetypes" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/types/known/wrapperspb" +) + +var ( + _ resource.ResourceWithConfigure = &ArchiveRetentionsResource{} + _ resource.ResourceWithImportState = &ArchiveRetentionsResource{} + getArchiveRetentionsURL = "com.coralogix.archive.v1.RetentionsService/GetRetentions" + updateArchiveRetentionsURL = "com.coralogix.archive.v1.RetentionsService/UpdateRetentions" +) + +func NewArchiveRetentionsResource() resource.Resource { + return &ArchiveRetentionsResource{} +} + +type ArchiveRetentionsResource struct { + client *clientset.ArchiveRetentionsClient +} + +func (r *ArchiveRetentionsResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_archive_retentions" +} + +func (r *ArchiveRetentionsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +func (r *ArchiveRetentionsResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + Version: 0, + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "retentions": schema.ListNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "The retention id.", + }, + "order": schema.Int64Attribute{ + Computed: true, + MarkdownDescription: "The retention order. Computed by the order of the retention in the retentions list definition.", + }, + "name": schema.StringAttribute{ + Computed: true, + Optional: true, + MarkdownDescription: "The retention name. If not set, the retention will be named by backend.", + }, + "editable": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Is the retention editable.", + }, + }, + }, + Required: true, + Validators: []validator.List{ + listvalidator.SizeBetween(4, 4), + retentionsValidator{}, + }, + MarkdownDescription: "List of 4 retentions. The first retention is the default retention and can't be renamed.", + }, + }, + MarkdownDescription: "Coralogix archive-retention. For more info please review - https://coralogix.com/docs/archive-setup-grpc-api/.", + } +} + +type retentionsValidator struct{} + +func (r retentionsValidator) Description(_ context.Context) string { + return "Retentions validator" +} + +func (r retentionsValidator) MarkdownDescription(_ context.Context) string { + return "Retentions validator" +} + +func (r retentionsValidator) ValidateList(ctx context.Context, req validator.ListRequest, resp *validator.ListResponse) { + if req.ConfigValue.IsNull() || req.ConfigValue.IsUnknown() { + resp.Diagnostics.AddError("error on validating retentions", "retentions can not be null or unknown") + } + + var retentionsObjects []types.Object + diag := req.ConfigValue.ElementsAs(ctx, &retentionsObjects, true) + if diag.HasError() { + resp.Diagnostics.Append(diag...) + return + } + + if length := len(retentionsObjects); length != 4 { + resp.Diagnostics.AddError("error on validating retentions", fmt.Sprintf("retentions list must have 4 elements but got %d", length)) + } + + var archiveRetentionResourceModel ArchiveRetentionResourceModel + retentionsObjects[0].As(ctx, &archiveRetentionResourceModel, basetypes.ObjectAsOptions{}) + if !archiveRetentionResourceModel.Name.IsNull() { + resp.Diagnostics.AddError("error on validating retentions", "first retention's name can't be set") + } +} + +type ArchiveRetentionsResourceModel struct { + Retentions types.List `tfsdk:"retentions"` //ArchiveRetentionResourceModel + ID types.String `tfsdk:"id"` +} + +type ArchiveRetentionResourceModel struct { + ID types.String `tfsdk:"id"` + Order types.Int64 `tfsdk:"order"` + Name types.String `tfsdk:"name"` + Editable types.Bool `tfsdk:"editable"` +} + +func (r *ArchiveRetentionsResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan *ArchiveRetentionsResourceModel + diags := req.Plan.Get(ctx, &plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + log.Print("[INFO] Reading archive-retentions") + getArchiveRetentionsReq := &archiveRetention.GetRetentionsRequest{} + getArchiveRetentionsResp, err := r.client.GetRetentions(ctx, getArchiveRetentionsReq) + if err != nil { + log.Printf("[ERROR] Received error: %#v", err) + formatRpcErrors(err, getArchiveRetentionsURL, protojson.Format(getArchiveRetentionsReq)) + return + } + log.Printf("[INFO] Received archive-retentions: %s", protojson.Format(getArchiveRetentionsResp)) + + createArchiveRetentions, diags := extractCreateArchiveRetentions(ctx, plan, getArchiveRetentionsResp.GetRetentions()) + if diags.HasError() { + resp.Diagnostics.Append(diags...) + return + } + archiveRetentionsStr := protojson.Format(createArchiveRetentions) + log.Printf("[INFO] Updating archive-retentions: %s", archiveRetentionsStr) + updateResp, err := r.client.UpdateRetentions(ctx, createArchiveRetentions) + if err != nil { + log.Printf("[ERROR] Received error: %s", err.Error()) + diags.AddError( + "Error creating archive-retentions", + formatRpcErrors(err, updateArchiveRetentionsURL, archiveRetentionsStr), + ) + return + } + log.Printf("[INFO] Submitted updated archive-retentions: %s", protojson.Format(updateResp)) + + plan, diags = flattenArchiveRetentions(ctx, updateResp.GetRetentions()) + if diags.HasError() { + resp.Diagnostics.Append(diags...) + return + } + // Set state to fully populated data + diags = resp.State.Set(ctx, plan) + resp.Diagnostics.Append(diags...) +} + +func flattenArchiveRetentions(ctx context.Context, retentions []*archiveRetention.Retention) (*ArchiveRetentionsResourceModel, diag.Diagnostics) { + if len(retentions) == 0 { + r, _ := types.ListValueFrom(ctx, types.ObjectType{AttrTypes: archiveRetentionAttributes()}, []types.Object{}) + return &ArchiveRetentionsResourceModel{ + Retentions: r, + ID: types.StringValue(""), + }, nil + } + + var diags diag.Diagnostics + var retentionsObjects []types.Object + for _, retention := range retentions { + retentionModel := ArchiveRetentionResourceModel{ + ID: wrapperspbStringToTypeString(retention.GetId()), + Order: wrapperspbInt32ToTypeInt64(retention.GetOrder()), + Name: wrapperspbStringToTypeString(retention.GetName()), + Editable: wrapperspbBoolToTypeBool(retention.GetEditable()), + } + retentionObject, flattenDiags := types.ObjectValueFrom(ctx, archiveRetentionAttributes(), retentionModel) + if flattenDiags.HasError() { + diags.Append(flattenDiags...) + continue + } + retentionsObjects = append(retentionsObjects, retentionObject) + } + if diags.HasError() { + return nil, diags + } + + flattenedRetentions, diags := types.ListValueFrom(ctx, types.ObjectType{AttrTypes: archiveRetentionAttributes()}, retentionsObjects) + if diags.HasError() { + return nil, diags + } + + return &ArchiveRetentionsResourceModel{ + Retentions: flattenedRetentions, + ID: types.StringValue(""), + }, nil +} + +func archiveRetentionAttributes() map[string]attr.Type { + return map[string]attr.Type{ + "id": types.StringType, + "order": types.Int64Type, + "name": types.StringType, + "editable": types.BoolType, + } +} + +func extractCreateArchiveRetentions(ctx context.Context, plan *ArchiveRetentionsResourceModel, exitingRetentions []*archiveRetention.Retention) (*archiveRetention.UpdateRetentionsRequest, diag.Diagnostics) { + var diags diag.Diagnostics + var retentions []*archiveRetention.RetentionUpdateElement + var retentionsObjects []types.Object + plan.Retentions.ElementsAs(ctx, &retentionsObjects, true) + for i, retentionObject := range retentionsObjects { + var retentionModel ArchiveRetentionResourceModel + if dg := retentionObject.As(ctx, &retentionModel, basetypes.ObjectAsOptions{}); dg.HasError() { + diags.Append(dg...) + continue + } + retentions = append(retentions, &archiveRetention.RetentionUpdateElement{ + Id: wrapperspb.String(exitingRetentions[i].GetId().GetValue()), + Name: typeStringToWrapperspbString(retentionModel.Name), + }) + + } + retentions[0].Name = wrapperspb.String("Default") + return &archiveRetention.UpdateRetentionsRequest{ + RetentionUpdateElements: retentions, + }, diags +} + +func extractUpdateArchiveRetentions(ctx context.Context, plan, state *ArchiveRetentionsResourceModel) (*archiveRetention.UpdateRetentionsRequest, diag.Diagnostics) { + var diags diag.Diagnostics + var planRetentionsObjects, stateRetentionsObjects []types.Object + plan.Retentions.ElementsAs(ctx, &planRetentionsObjects, true) + state.Retentions.ElementsAs(ctx, &stateRetentionsObjects, true) + + var retentions []*archiveRetention.RetentionUpdateElement + for i := range planRetentionsObjects { + var planRetentionModel, stateRetentionModel ArchiveRetentionResourceModel + if dg := planRetentionsObjects[i].As(ctx, &planRetentionModel, basetypes.ObjectAsOptions{}); dg.HasError() { + diags.Append(dg...) + continue + } + if dg := stateRetentionsObjects[i].As(ctx, &stateRetentionModel, basetypes.ObjectAsOptions{}); dg.HasError() { + diags.Append(dg...) + continue + } + retentions = append(retentions, &archiveRetention.RetentionUpdateElement{ + Id: typeStringToWrapperspbString(stateRetentionModel.ID), + Name: typeStringToWrapperspbString(planRetentionModel.Name), + }) + } + retentions[0].Name = wrapperspb.String("Default") + return &archiveRetention.UpdateRetentionsRequest{ + RetentionUpdateElements: retentions, + }, diags +} + +func (r *ArchiveRetentionsResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state *ArchiveRetentionsResourceModel + diags := req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + log.Print("[INFO] Reading archive-retentions") + getArchiveRetentionsReq := &archiveRetention.GetRetentionsRequest{} + getArchiveRetentionsResp, err := r.client.GetRetentions(ctx, getArchiveRetentionsReq) + if err != nil { + log.Printf("[ERROR] Received error: %#v", err) + formatRpcErrors(err, getArchiveRetentionsURL, protojson.Format(getArchiveRetentionsReq)) + return + } + log.Printf("[INFO] Received archive-retentions: %s", protojson.Format(getArchiveRetentionsResp)) + + state, diags = flattenArchiveRetentions(ctx, getArchiveRetentionsResp.GetRetentions()) + if diags.HasError() { + resp.Diagnostics.Append(diags...) + return + } + diags = resp.State.Set(ctx, &state) + resp.Diagnostics.Append(diags...) +} + +func (r *ArchiveRetentionsResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + // Retrieve values from plan + var plan *ArchiveRetentionsResourceModel + diags := req.Plan.Get(ctx, &plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + var state *ArchiveRetentionsResourceModel + diags = req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + archiveRetentionsUpdateReq, diags := extractUpdateArchiveRetentions(ctx, plan, state) + if diags.HasError() { + resp.Diagnostics.Append(diags...) + return + } + log.Printf("[INFO] Updating archive-retentions: %s", protojson.Format(archiveRetentionsUpdateReq)) + archiveRetentionsUpdateResp, err := r.client.UpdateRetentions(ctx, archiveRetentionsUpdateReq) + if err != nil { + log.Printf("[ERROR] Received error: %#v", err) + resp.Diagnostics.AddError( + "Error updating archive-retentions", + formatRpcErrors(err, updateArchiveRetentionsURL, protojson.Format(archiveRetentionsUpdateReq)), + ) + return + } + log.Printf("[INFO] Submitted updated archive-retentions: %s", protojson.Format(archiveRetentionsUpdateResp)) + + // Get refreshed archive-retentions value from Coralogix + getArchiveRetentionsReq := &archiveRetention.GetRetentionsRequest{} + getArchiveRetentionsResp, err := r.client.GetRetentions(ctx, getArchiveRetentionsReq) + if err != nil { + log.Printf("[ERROR] Received error: %s", err.Error()) + resp.Diagnostics.AddError( + "Error reading archive-retentions", + formatRpcErrors(err, getArchiveRetentionsURL, protojson.Format(getArchiveRetentionsReq)), + ) + return + } + log.Printf("[INFO] Received archive-retentions: %s", protojson.Format(getArchiveRetentionsResp)) + + plan, diags = flattenArchiveRetentions(ctx, getArchiveRetentionsResp.GetRetentions()) + if diags.HasError() { + resp.Diagnostics.Append(diags...) + return + } + // Set state to fully populated data + diags = resp.State.Set(ctx, plan) + resp.Diagnostics.Append(diags...) +} + +func (r *ArchiveRetentionsResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state ArchiveRetentionsResourceModel + diags := req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + log.Print("[INFO] Deleting archive-retentions") + deleteReq := &archiveRetention.UpdateRetentionsRequest{} + if _, err := r.client.UpdateRetentions(ctx, deleteReq); err != nil { + resp.Diagnostics.AddError( + "Error Deleting archive-retentions", + formatRpcErrors(err, updateArchiveRetentionsURL, protojson.Format(deleteReq)), + ) + return + } + log.Print("[INFO] archive-retentions were deleted") +} + +func (r *ArchiveRetentionsResource) Configure(_ context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + clientSet, ok := req.ProviderData.(*clientset.ClientSet) + if !ok { + resp.Diagnostics.AddError( + "Unexpected Resource Configure Type", + fmt.Sprintf("Expected *clientset.ClientSet, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + return + } + + r.client = clientSet.ArchiveRetentions() +} diff --git a/coralogix/resource_coralogix_archive_retention_test.go b/coralogix/resource_coralogix_archive_retention_test.go new file mode 100644 index 00000000..e445afa9 --- /dev/null +++ b/coralogix/resource_coralogix_archive_retention_test.go @@ -0,0 +1,81 @@ +package coralogix + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" +) + +var ( + archiveRetentionsResourceName = "coralogix_archive_retentions.test" +) + +func TestAccCoralogixResourceResourceArchiveRetentions(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccCoralogixResourceArchiveRetentions(), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(archiveRetentionsResourceName, "retentions.0.name", "Default"), + resource.TestCheckResourceAttr(archiveRetentionsResourceName, "retentions.1.name", "name_2"), + resource.TestCheckResourceAttr(archiveRetentionsResourceName, "retentions.2.name", "name_3"), + resource.TestCheckResourceAttr(archiveRetentionsResourceName, "retentions.3.name", "name_4"), + ), + }, + { + ResourceName: archiveRetentionsResourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccCoralogixResourceArchiveRetentionsUpdate(), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(archiveRetentionsResourceName, "retentions.0.name", "Default"), + resource.TestCheckResourceAttr(archiveRetentionsResourceName, "retentions.1.name", "new_name_2"), + resource.TestCheckResourceAttr(archiveRetentionsResourceName, "retentions.2.name", "new_name_3"), + resource.TestCheckResourceAttr(archiveRetentionsResourceName, "retentions.3.name", "new_name_4"), + ), + }, + }, + }) +} + +func testAccCoralogixResourceArchiveRetentions() string { + return `resource "coralogix_archive_retentions" "test" { + retentions = [ + { + }, + { + name = "name_2" + }, + { + name = "name_3" + }, + { + name = "name_4" + }, + ] +} +` +} + +func testAccCoralogixResourceArchiveRetentionsUpdate() string { + return `resource "coralogix_archive_retentions" "test" { + retentions = [ + { + }, + { + name = "new_name_2" + }, + { + name = "new_name_3" + }, + { + name = "new_name_4" + }, + ] +} +` +} diff --git a/coralogix/resource_coralogix_data_set.go b/coralogix/resource_coralogix_data_set.go index 68d12ee8..4f68c443 100644 --- a/coralogix/resource_coralogix_data_set.go +++ b/coralogix/resource_coralogix_data_set.go @@ -183,7 +183,7 @@ func resourceCoralogixDataSetUpdate(ctx context.Context, d *schema.ResourceData, _, err = meta.(*clientset.ClientSet).DataSet().UpdateDataSet(ctx, req) if err != nil { log.Printf("[ERROR] Received error: %#v", err) - return diag.Errorf(formatRpcErrors(err, getDataSetURL, protojson.Format(req))) + return diag.Errorf(formatRpcErrors(err, updateDataSetURL, protojson.Format(req))) } if uploadedFile, ok := d.GetOk("uploaded_file"); ok { diff --git a/coralogix/resource_coralogix_webhook.go b/coralogix/resource_coralogix_webhook.go index 8a1e3e16..96254e89 100644 --- a/coralogix/resource_coralogix_webhook.go +++ b/coralogix/resource_coralogix_webhook.go @@ -782,7 +782,7 @@ func (r WebhookResource) Delete(ctx context.Context, req resource.DeleteRequest, log.Printf("[ERROR] Received error: %#v", err) resp.Diagnostics.AddError( "Error deleting Webhook", - formatRpcErrors(err, deleteTCOPolicyURL, protojson.Format(deleteReq)), + formatRpcErrors(err, deleteWebhookURL, protojson.Format(deleteReq)), ) return } diff --git a/coralogix/utils.go b/coralogix/utils.go index 7d174079..4277b39a 100644 --- a/coralogix/utils.go +++ b/coralogix/utils.go @@ -94,10 +94,12 @@ func datasourceSchemaFromResourceSchema(rs map[string]*schema.Schema) map[string func frameworkDatasourceSchemaFromFrameworkResourceSchema(rs resourceschema.Schema) datasourceschema.Schema { attributes := convertAttributes(rs.Attributes) - attributes["id"] = datasourceschema.StringAttribute{ - Required: true, - Description: rs.Attributes["id"].GetDescription(), - MarkdownDescription: rs.Attributes["id"].GetMarkdownDescription(), + if idSchema, ok := rs.Attributes["id"]; ok { + attributes["id"] = datasourceschema.StringAttribute{ + Required: true, + Description: idSchema.GetDescription(), + MarkdownDescription: idSchema.GetMarkdownDescription(), + } } return datasourceschema.Schema{ @@ -482,14 +484,6 @@ func reverseMapStrings(m map[string]string) map[string]string { return n } -func reverseMapIntToString(m map[string]int) map[int]string { - n := make(map[int]string) - for k, v := range m { - n[v] = k - } - return n -} - func reverseMapRelativeTimeFrame(m map[string]protoTimeFrameAndRelativeTimeFrame) map[protoTimeFrameAndRelativeTimeFrame]string { n := make(map[protoTimeFrameAndRelativeTimeFrame]string) for k, v := range m { diff --git a/docs/data-sources/archive_retentions.md b/docs/data-sources/archive_retentions.md new file mode 100644 index 00000000..08dc0a4f --- /dev/null +++ b/docs/data-sources/archive_retentions.md @@ -0,0 +1,35 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "coralogix_archive_retentions Data Source - terraform-provider-coralogix" +subcategory: "" +description: |- + Coralogix archive-retention. For more info please review - https://coralogix.com/docs/archive-setup-grpc-api/. +--- + +# coralogix_archive_retentions (Data Source) + +Coralogix archive-retention. For more info please review - https://coralogix.com/docs/archive-setup-grpc-api/. +```hcl +resource "coralogix_archive_retentions" "example" { + data "coralogix_archive_retentions" "example" { + } +} +``` + + + +## Schema + +### Read-Only + +- `retentions` (Attributes List) (see [below for nested schema](#nestedatt--retentions)) + + +### Nested Schema for `retentions` + +Read-Only: + +- `editable` (Boolean) Is the retention editable. +- `id` (String) The retention id. +- `name` (String) The retention name. If not set, the retention will be named by backend. +- `order` (Number) The retention order. Computed by the order of the retention in the retentions list definition. diff --git a/docs/resources/archive_retentions.md b/docs/resources/archive_retentions.md new file mode 100644 index 00000000..8341e18b --- /dev/null +++ b/docs/resources/archive_retentions.md @@ -0,0 +1,51 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "coralogix_archive_retentions Resource - terraform-provider-coralogix" +subcategory: "" +description: "Coralogix archive-retention. For more info please review - https://coralogix.com/docs/archive-setup-grpc-api/." +--- + +# coralogix_archive_retentions (Resource) + +Coralogix archive-retention. For more info please review - https://coralogix.com/docs/archive-setup-grpc-api/. + +## Example Usage + +```hcl +resource "coralogix_archive_retentions" "example" { + retentions = [ + { + }, + { + name = "name_2" + }, + { + name = "name_3" + }, + { + name = "name_4" + }, + ] +} +``` + +**Please note** - The coralogix_archive_retentions should be used as a singleton, meaning there's no option to handle few lists of retentions at the same account. the retentions list must contain exactly 4 retentions and the first retention is the default retention and can't be renamed. + +## Schema + +### Required + +- `retentions` (Attributes List) List of 4 retentions. The first retention is the default retention and can't be renamed. (see [below for nested schema](#nestedatt--retentions)) + + +### Nested Schema for `retentions` + +Optional: + +- `name` (String) The retention name. If not set, the retention will be named by backend. + +Read-Only: + +- `editable` (Boolean) Is the retention editable. +- `id` (String) The retention id. +- `order` (Number) The retention order. Computed by the order of the retention in the retentions list definition. diff --git a/examples/archive_retentions/main.tf b/examples/archive_retentions/main.tf new file mode 100644 index 00000000..92fa3781 --- /dev/null +++ b/examples/archive_retentions/main.tf @@ -0,0 +1,32 @@ +terraform { + required_providers { + coralogix = { + version = "~> 1.10" + source = "coralogix/coralogix" + } + } +} + +provider "coralogix" { + #api_key = "" + #env = "" +} + +resource "coralogix_archive_retentions" "example" { + retentions = [ + { + }, + { + name = "name_2" + }, + { + name = "name_3" + }, + { + name = "name_4" + }, + ] +} + +data "coralogix_archive_retentions" "example" { +} \ No newline at end of file