diff --git a/CHANGELOG.md b/CHANGELOG.md index 95293ec4..d9b353ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -244,4 +244,31 @@ BUG FIXING: ## Release 1.6.5 INTERNAL CHANGES: -* `tco_policy` and `tco_policy_override` endpoints were changed. \ No newline at end of file +#### resource/coralogix_tco_policy +* `tco_policy` and `tco_policy_override` endpoints were changed. + +## Release 1.7.0 +Breaking Changes: +#### resource/coralogix_tco_policy was changed to coralogix_tco_policy_logs and contains the next changes: +* `subsystem_name` was changed to `subsystems` and have different structure e.g. - +`subsystem_name { + is = true + rules = ["mobile", "web"] + }` => `subsystems = { + rule_type = "is" + names = ["mobile", "web"] + }` +* `application_name` was changed to `applications` and have different structure e.g. - `application_name { + starts_with = true + rule = "prod" + }` => `applications = { + rule_type = "starts_with" + names = ["prod"] + }` + +**Please note** - this version contains a [State Upgrader](https://developer.hashicorp.com/terraform/plugin/framework/migrating/resources/state-upgrade#framework). It will upgrade the state to the new schema. Please make sure to back up your state before upgrading. +(for upgrading the schemas the resource names have to be change manually to coralogix_tco_policy_logs before upgrading) +DEVELOPERS: +#### resource/coralogix_tco_policy +* using grpc endpoint instead of the REST endpoint. +* moved to `plugin-framework`. \ No newline at end of file diff --git a/coralogix/clientset/clientset.go b/coralogix/clientset/clientset.go index 280bc852..66e838dc 100644 --- a/coralogix/clientset/clientset.go +++ b/coralogix/clientset/clientset.go @@ -9,7 +9,7 @@ type ClientSet struct { grafanaDashboards *GrafanaDashboardClient actions *ActionsClient recordingRuleGroups *RecordingRulesGroupsSetsClient - tcoPolicies *TCOPolicies + tcoPolicies *TCOPoliciesClient tcoPoliciesOverrides *TCOPoliciesOverrides webhooks *WebhooksClient events2Metrics *Events2MetricsClient @@ -47,7 +47,7 @@ func (c *ClientSet) RecordingRuleGroupsSets() *RecordingRulesGroupsSetsClient { return c.recordingRuleGroups } -func (c *ClientSet) TCOPolicies() *TCOPolicies { +func (c *ClientSet) TCOPolicies() *TCOPoliciesClient { return c.tcoPolicies } diff --git a/coralogix/clientset/grpc/tco-policies/archive_retention.pb.go b/coralogix/clientset/grpc/tco-policies/archive_retention.pb.go new file mode 100644 index 00000000..8b298a99 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/archive_retention.pb.go @@ -0,0 +1,151 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/archive_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 ArchiveRetention struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *ArchiveRetention) Reset() { + *x = ArchiveRetention{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_archive_retention_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ArchiveRetention) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArchiveRetention) ProtoMessage() {} + +func (x *ArchiveRetention) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_archive_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 ArchiveRetention.ProtoReflect.Descriptor instead. +func (*ArchiveRetention) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_archive_retention_proto_rawDescGZIP(), []int{0} +} + +func (x *ArchiveRetention) GetId() *wrapperspb.StringValue { + if x != nil { + return x.Id + } + return nil +} + +var File_com_coralogix_quota_v1_archive_retention_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_archive_retention_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, + 0x5f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, + 0x71, 0x75, 0x6f, 0x74, 0x61, 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, 0x40, 0x0a, 0x10, 0x41, 0x72, 0x63, 0x68, + 0x69, 0x76, 0x65, 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, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_archive_retention_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_archive_retention_proto_rawDescData = file_com_coralogix_quota_v1_archive_retention_proto_rawDesc +) + +func file_com_coralogix_quota_v1_archive_retention_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_archive_retention_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_archive_retention_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_archive_retention_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_archive_retention_proto_rawDescData +} + +var file_com_coralogix_quota_v1_archive_retention_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_archive_retention_proto_goTypes = []interface{}{ + (*ArchiveRetention)(nil), // 0: com.coralogix.quota.v1.ArchiveRetention + (*wrapperspb.StringValue)(nil), // 1: google.protobuf.StringValue +} +var file_com_coralogix_quota_v1_archive_retention_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.ArchiveRetention.id:type_name -> google.protobuf.StringValue + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_archive_retention_proto_init() } +func file_com_coralogix_quota_v1_archive_retention_proto_init() { + if File_com_coralogix_quota_v1_archive_retention_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_archive_retention_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ArchiveRetention); 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_quota_v1_archive_retention_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_archive_retention_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_archive_retention_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_archive_retention_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_archive_retention_proto = out.File + file_com_coralogix_quota_v1_archive_retention_proto_rawDesc = nil + file_com_coralogix_quota_v1_archive_retention_proto_goTypes = nil + file_com_coralogix_quota_v1_archive_retention_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/audit_log.pb.go b/coralogix/clientset/grpc/tco-policies/audit_log.pb.go new file mode 100644 index 00000000..9e1c1536 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/audit_log.pb.go @@ -0,0 +1,180 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/audit_log.proto + +package __ + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + 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 AuditLogDescription struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Description *string `protobuf:"bytes,1,opt,name=description,proto3,oneof" json:"description,omitempty"` +} + +func (x *AuditLogDescription) Reset() { + *x = AuditLogDescription{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_audit_log_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AuditLogDescription) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuditLogDescription) ProtoMessage() {} + +func (x *AuditLogDescription) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_audit_log_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 AuditLogDescription.ProtoReflect.Descriptor instead. +func (*AuditLogDescription) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_audit_log_proto_rawDescGZIP(), []int{0} +} + +func (x *AuditLogDescription) GetDescription() string { + if x != nil && x.Description != nil { + return *x.Description + } + return "" +} + +var file_com_coralogix_quota_v1_audit_log_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptorpb.MethodOptions)(nil), + ExtensionType: (*AuditLogDescription)(nil), + Field: 5000, + Name: "com.coralogix.quota.v1.audit_log_description", + Tag: "bytes,5000,opt,name=audit_log_description", + Filename: "com/coralogix/quota/v1/audit_log.proto", + }, +} + +// Extension fields to descriptorpb.MethodOptions. +var ( + // optional com.coralogix.quota.v1.AuditLogDescription audit_log_description = 5000; + E_AuditLogDescription = &file_com_coralogix_quota_v1_audit_log_proto_extTypes[0] +) + +var File_com_coralogix_quota_v1_audit_log_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_audit_log_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x5f, 0x6c, + 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, + 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, 0x22, 0x4c, 0x0a, 0x13, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x44, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, + 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x3a, 0x83, 0x01, 0x0a, 0x15, 0x61, 0x75, 0x64, 0x69, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x88, 0x27, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, + 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x74, + 0x4c, 0x6f, 0x67, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, + 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_audit_log_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_audit_log_proto_rawDescData = file_com_coralogix_quota_v1_audit_log_proto_rawDesc +) + +func file_com_coralogix_quota_v1_audit_log_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_audit_log_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_audit_log_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_audit_log_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_audit_log_proto_rawDescData +} + +var file_com_coralogix_quota_v1_audit_log_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_audit_log_proto_goTypes = []interface{}{ + (*AuditLogDescription)(nil), // 0: com.coralogix.quota.v1.AuditLogDescription + (*descriptorpb.MethodOptions)(nil), // 1: google.protobuf.MethodOptions +} +var file_com_coralogix_quota_v1_audit_log_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.audit_log_description:extendee -> google.protobuf.MethodOptions + 0, // 1: com.coralogix.quota.v1.audit_log_description:type_name -> com.coralogix.quota.v1.AuditLogDescription + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 1, // [1:2] is the sub-list for extension type_name + 0, // [0:1] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_audit_log_proto_init() } +func file_com_coralogix_quota_v1_audit_log_proto_init() { + if File_com_coralogix_quota_v1_audit_log_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_audit_log_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AuditLogDescription); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_com_coralogix_quota_v1_audit_log_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_com_coralogix_quota_v1_audit_log_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 1, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_audit_log_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_audit_log_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_audit_log_proto_msgTypes, + ExtensionInfos: file_com_coralogix_quota_v1_audit_log_proto_extTypes, + }.Build() + File_com_coralogix_quota_v1_audit_log_proto = out.File + file_com_coralogix_quota_v1_audit_log_proto_rawDesc = nil + file_com_coralogix_quota_v1_audit_log_proto_goTypes = nil + file_com_coralogix_quota_v1_audit_log_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/bulk_test_log_policies_request.pb.go b/coralogix/clientset/grpc/tco-policies/bulk_test_log_policies_request.pb.go new file mode 100644 index 00000000..9319f9cb --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/bulk_test_log_policies_request.pb.go @@ -0,0 +1,157 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/bulk_test_log_policies_request.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 BulkTestLogPoliciesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MetaFieldsValuesList []*LogMetaFieldsValues `protobuf:"bytes,1,rep,name=meta_fields_values_list,json=metaFieldsValuesList,proto3" json:"meta_fields_values_list,omitempty"` +} + +func (x *BulkTestLogPoliciesRequest) Reset() { + *x = BulkTestLogPoliciesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BulkTestLogPoliciesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BulkTestLogPoliciesRequest) ProtoMessage() {} + +func (x *BulkTestLogPoliciesRequest) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_bulk_test_log_policies_request_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 BulkTestLogPoliciesRequest.ProtoReflect.Descriptor instead. +func (*BulkTestLogPoliciesRequest) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_rawDescGZIP(), []int{0} +} + +func (x *BulkTestLogPoliciesRequest) GetMetaFieldsValuesList() []*LogMetaFieldsValues { + if x != nil { + return x.MetaFieldsValuesList + } + return nil +} + +var File_com_coralogix_quota_v1_bulk_test_log_policies_request_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_rawDesc = []byte{ + 0x0a, 0x3b, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x75, 0x6c, 0x6b, 0x5f, 0x74, 0x65, + 0x73, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5f, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, + 0x74, 0x61, 0x2e, 0x76, 0x31, 0x1a, 0x32, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, + 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, + 0x67, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, 0x1a, 0x42, 0x75, + 0x6c, 0x6b, 0x54, 0x65, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x62, 0x0a, 0x17, 0x6d, 0x65, 0x74, 0x61, + 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x5f, 0x6c, + 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x14, 0x6d, 0x65, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x04, 0x5a, 0x02, + 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_rawDescData = file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_rawDesc +) + +func file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_rawDescData +} + +var file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_goTypes = []interface{}{ + (*BulkTestLogPoliciesRequest)(nil), // 0: com.coralogix.quota.v1.BulkTestLogPoliciesRequest + (*LogMetaFieldsValues)(nil), // 1: com.coralogix.quota.v1.LogMetaFieldsValues +} +var file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.BulkTestLogPoliciesRequest.meta_fields_values_list:type_name -> com.coralogix.quota.v1.LogMetaFieldsValues + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_init() } +func file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_init() { + if File_com_coralogix_quota_v1_bulk_test_log_policies_request_proto != nil { + return + } + file_com_coralogix_quota_v1_log_meta_field_values_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BulkTestLogPoliciesRequest); 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_quota_v1_bulk_test_log_policies_request_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_bulk_test_log_policies_request_proto = out.File + file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_rawDesc = nil + file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_goTypes = nil + file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/bulk_test_log_policies_response.pb.go b/coralogix/clientset/grpc/tco-policies/bulk_test_log_policies_response.pb.go new file mode 100644 index 00000000..4bb71e95 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/bulk_test_log_policies_response.pb.go @@ -0,0 +1,157 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/bulk_test_log_policies_response.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 BulkTestLogPoliciesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TestPoliciesBulkResult []*TestPoliciesResult `protobuf:"bytes,1,rep,name=test_policies_bulk_result,json=testPoliciesBulkResult,proto3" json:"test_policies_bulk_result,omitempty"` +} + +func (x *BulkTestLogPoliciesResponse) Reset() { + *x = BulkTestLogPoliciesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BulkTestLogPoliciesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BulkTestLogPoliciesResponse) ProtoMessage() {} + +func (x *BulkTestLogPoliciesResponse) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_bulk_test_log_policies_response_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 BulkTestLogPoliciesResponse.ProtoReflect.Descriptor instead. +func (*BulkTestLogPoliciesResponse) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_rawDescGZIP(), []int{0} +} + +func (x *BulkTestLogPoliciesResponse) GetTestPoliciesBulkResult() []*TestPoliciesResult { + if x != nil { + return x.TestPoliciesBulkResult + } + return nil +} + +var File_com_coralogix_quota_v1_bulk_test_log_policies_response_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_rawDesc = []byte{ + 0x0a, 0x3c, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x75, 0x6c, 0x6b, 0x5f, 0x74, 0x65, + 0x73, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5f, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, + 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x1a, 0x31, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, + 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x74, + 0x65, 0x73, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x84, 0x01, 0x0a, 0x1b, 0x42, 0x75, + 0x6c, 0x6b, 0x54, 0x65, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x19, 0x74, 0x65, 0x73, + 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5f, 0x62, 0x75, 0x6c, 0x6b, 0x5f, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, + 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x16, 0x74, 0x65, 0x73, 0x74, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x42, 0x75, 0x6c, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_rawDescData = file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_rawDesc +) + +func file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_rawDescData +} + +var file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_goTypes = []interface{}{ + (*BulkTestLogPoliciesResponse)(nil), // 0: com.coralogix.quota.v1.BulkTestLogPoliciesResponse + (*TestPoliciesResult)(nil), // 1: com.coralogix.quota.v1.TestPoliciesResult +} +var file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.BulkTestLogPoliciesResponse.test_policies_bulk_result:type_name -> com.coralogix.quota.v1.TestPoliciesResult + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_init() } +func file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_init() { + if File_com_coralogix_quota_v1_bulk_test_log_policies_response_proto != nil { + return + } + file_com_coralogix_quota_v1_test_policies_result_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BulkTestLogPoliciesResponse); 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_quota_v1_bulk_test_log_policies_response_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_bulk_test_log_policies_response_proto = out.File + file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_rawDesc = nil + file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_goTypes = nil + file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/create_policy_request.pb.go b/coralogix/clientset/grpc/tco-policies/create_policy_request.pb.go new file mode 100644 index 00000000..a4813fae --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/create_policy_request.pb.go @@ -0,0 +1,303 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/create_policy_request.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 CreatePolicyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Priority Priority `protobuf:"varint,3,opt,name=priority,proto3,enum=com.coralogix.quota.v1.Priority" json:"priority,omitempty"` + ApplicationRule *Rule `protobuf:"bytes,4,opt,name=application_rule,json=applicationRule,proto3,oneof" json:"application_rule,omitempty"` + SubsystemRule *Rule `protobuf:"bytes,5,opt,name=subsystem_rule,json=subsystemRule,proto3,oneof" json:"subsystem_rule,omitempty"` + ArchiveRetention *ArchiveRetention `protobuf:"bytes,6,opt,name=archive_retention,json=archiveRetention,proto3,oneof" json:"archive_retention,omitempty"` + // Types that are assignable to SourceTypeRules: + // *CreatePolicyRequest_LogRules + // *CreatePolicyRequest_SpanRules + SourceTypeRules isCreatePolicyRequest_SourceTypeRules `protobuf_oneof:"source_type_rules"` +} + +func (x *CreatePolicyRequest) Reset() { + *x = CreatePolicyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_create_policy_request_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreatePolicyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatePolicyRequest) ProtoMessage() {} + +func (x *CreatePolicyRequest) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_create_policy_request_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 CreatePolicyRequest.ProtoReflect.Descriptor instead. +func (*CreatePolicyRequest) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_create_policy_request_proto_rawDescGZIP(), []int{0} +} + +func (x *CreatePolicyRequest) GetName() *wrapperspb.StringValue { + if x != nil { + return x.Name + } + return nil +} + +func (x *CreatePolicyRequest) GetDescription() *wrapperspb.StringValue { + if x != nil { + return x.Description + } + return nil +} + +func (x *CreatePolicyRequest) GetPriority() Priority { + if x != nil { + return x.Priority + } + return Priority_PRIORITY_TYPE_UNSPECIFIED +} + +func (x *CreatePolicyRequest) GetApplicationRule() *Rule { + if x != nil { + return x.ApplicationRule + } + return nil +} + +func (x *CreatePolicyRequest) GetSubsystemRule() *Rule { + if x != nil { + return x.SubsystemRule + } + return nil +} + +func (x *CreatePolicyRequest) GetArchiveRetention() *ArchiveRetention { + if x != nil { + return x.ArchiveRetention + } + return nil +} + +func (m *CreatePolicyRequest) GetSourceTypeRules() isCreatePolicyRequest_SourceTypeRules { + if m != nil { + return m.SourceTypeRules + } + return nil +} + +func (x *CreatePolicyRequest) GetLogRules() *LogRules { + if x, ok := x.GetSourceTypeRules().(*CreatePolicyRequest_LogRules); ok { + return x.LogRules + } + return nil +} + +func (x *CreatePolicyRequest) GetSpanRules() *SpanRules { + if x, ok := x.GetSourceTypeRules().(*CreatePolicyRequest_SpanRules); ok { + return x.SpanRules + } + return nil +} + +type isCreatePolicyRequest_SourceTypeRules interface { + isCreatePolicyRequest_SourceTypeRules() +} + +type CreatePolicyRequest_LogRules struct { + LogRules *LogRules `protobuf:"bytes,7,opt,name=log_rules,json=logRules,proto3,oneof"` +} + +type CreatePolicyRequest_SpanRules struct { + SpanRules *SpanRules `protobuf:"bytes,8,opt,name=span_rules,json=spanRules,proto3,oneof"` +} + +func (*CreatePolicyRequest_LogRules) isCreatePolicyRequest_SourceTypeRules() {} + +func (*CreatePolicyRequest_SpanRules) isCreatePolicyRequest_SourceTypeRules() {} + +var File_com_coralogix_quota_v1_create_policy_request_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_create_policy_request_proto_rawDesc = []byte{ + 0x0a, 0x32, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 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, 0x22, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, + 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x21, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x72, 0x63, 0x68, + 0x69, 0x76, 0x65, 0x5f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x5f, + 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x91, 0x05, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 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, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 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, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, + 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, + 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x4c, 0x0a, 0x10, + 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, + 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, + 0x52, 0x75, 0x6c, 0x65, 0x48, 0x01, 0x52, 0x0f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x48, 0x0a, 0x0e, 0x73, 0x75, + 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6c, 0x65, + 0x48, 0x02, 0x52, 0x0d, 0x73, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x75, 0x6c, + 0x65, 0x88, 0x01, 0x01, 0x12, 0x5a, 0x0a, 0x11, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, + 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x28, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, + 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x03, 0x52, 0x10, 0x61, 0x72, 0x63, + 0x68, 0x69, 0x76, 0x65, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, + 0x12, 0x3f, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, + 0x52, 0x75, 0x6c, 0x65, 0x73, 0x48, 0x00, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x52, 0x75, 0x6c, 0x65, + 0x73, 0x12, 0x42, 0x0a, 0x0a, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, + 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x70, 0x61, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x48, 0x00, 0x52, 0x09, 0x73, 0x70, 0x61, 0x6e, + 0x52, 0x75, 0x6c, 0x65, 0x73, 0x42, 0x13, 0x0a, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x61, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x42, + 0x11, 0x0a, 0x0f, 0x5f, 0x73, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x72, 0x75, + 0x6c, 0x65, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, 0x72, + 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_create_policy_request_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_create_policy_request_proto_rawDescData = file_com_coralogix_quota_v1_create_policy_request_proto_rawDesc +) + +func file_com_coralogix_quota_v1_create_policy_request_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_create_policy_request_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_create_policy_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_create_policy_request_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_create_policy_request_proto_rawDescData +} + +var file_com_coralogix_quota_v1_create_policy_request_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_create_policy_request_proto_goTypes = []interface{}{ + (*CreatePolicyRequest)(nil), // 0: com.coralogix.quota.v1.CreatePolicyRequest + (*wrapperspb.StringValue)(nil), // 1: google.protobuf.StringValue + (Priority)(0), // 2: com.coralogix.quota.v1.Priority + (*Rule)(nil), // 3: com.coralogix.quota.v1.Rule + (*ArchiveRetention)(nil), // 4: com.coralogix.quota.v1.ArchiveRetention + (*LogRules)(nil), // 5: com.coralogix.quota.v1.LogRules + (*SpanRules)(nil), // 6: com.coralogix.quota.v1.SpanRules +} +var file_com_coralogix_quota_v1_create_policy_request_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.CreatePolicyRequest.name:type_name -> google.protobuf.StringValue + 1, // 1: com.coralogix.quota.v1.CreatePolicyRequest.description:type_name -> google.protobuf.StringValue + 2, // 2: com.coralogix.quota.v1.CreatePolicyRequest.priority:type_name -> com.coralogix.quota.v1.Priority + 3, // 3: com.coralogix.quota.v1.CreatePolicyRequest.application_rule:type_name -> com.coralogix.quota.v1.Rule + 3, // 4: com.coralogix.quota.v1.CreatePolicyRequest.subsystem_rule:type_name -> com.coralogix.quota.v1.Rule + 4, // 5: com.coralogix.quota.v1.CreatePolicyRequest.archive_retention:type_name -> com.coralogix.quota.v1.ArchiveRetention + 5, // 6: com.coralogix.quota.v1.CreatePolicyRequest.log_rules:type_name -> com.coralogix.quota.v1.LogRules + 6, // 7: com.coralogix.quota.v1.CreatePolicyRequest.span_rules:type_name -> com.coralogix.quota.v1.SpanRules + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_create_policy_request_proto_init() } +func file_com_coralogix_quota_v1_create_policy_request_proto_init() { + if File_com_coralogix_quota_v1_create_policy_request_proto != nil { + return + } + file_com_coralogix_quota_v1_enums_proto_init() + file_com_coralogix_quota_v1_rule_proto_init() + file_com_coralogix_quota_v1_archive_retention_proto_init() + file_com_coralogix_quota_v1_log_rules_proto_init() + file_com_coralogix_quota_v1_span_rules_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_create_policy_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreatePolicyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_com_coralogix_quota_v1_create_policy_request_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*CreatePolicyRequest_LogRules)(nil), + (*CreatePolicyRequest_SpanRules)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_com_coralogix_quota_v1_create_policy_request_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_create_policy_request_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_create_policy_request_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_create_policy_request_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_create_policy_request_proto = out.File + file_com_coralogix_quota_v1_create_policy_request_proto_rawDesc = nil + file_com_coralogix_quota_v1_create_policy_request_proto_goTypes = nil + file_com_coralogix_quota_v1_create_policy_request_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/create_policy_response.pb.go b/coralogix/clientset/grpc/tco-policies/create_policy_response.pb.go new file mode 100644 index 00000000..017cb9ca --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/create_policy_response.pb.go @@ -0,0 +1,152 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/create_policy_response.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 CreatePolicyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Policy *Policy `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy,omitempty"` +} + +func (x *CreatePolicyResponse) Reset() { + *x = CreatePolicyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_create_policy_response_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreatePolicyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatePolicyResponse) ProtoMessage() {} + +func (x *CreatePolicyResponse) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_create_policy_response_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 CreatePolicyResponse.ProtoReflect.Descriptor instead. +func (*CreatePolicyResponse) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_create_policy_response_proto_rawDescGZIP(), []int{0} +} + +func (x *CreatePolicyResponse) GetPolicy() *Policy { + if x != nil { + return x.Policy + } + return nil +} + +var File_com_coralogix_quota_v1_create_policy_response_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_create_policy_response_proto_rawDesc = []byte{ + 0x0a, 0x33, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, + 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x1a, 0x23, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, + 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x4e, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_create_policy_response_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_create_policy_response_proto_rawDescData = file_com_coralogix_quota_v1_create_policy_response_proto_rawDesc +) + +func file_com_coralogix_quota_v1_create_policy_response_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_create_policy_response_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_create_policy_response_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_create_policy_response_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_create_policy_response_proto_rawDescData +} + +var file_com_coralogix_quota_v1_create_policy_response_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_create_policy_response_proto_goTypes = []interface{}{ + (*CreatePolicyResponse)(nil), // 0: com.coralogix.quota.v1.CreatePolicyResponse + (*Policy)(nil), // 1: com.coralogix.quota.v1.Policy +} +var file_com_coralogix_quota_v1_create_policy_response_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.CreatePolicyResponse.policy:type_name -> com.coralogix.quota.v1.Policy + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_create_policy_response_proto_init() } +func file_com_coralogix_quota_v1_create_policy_response_proto_init() { + if File_com_coralogix_quota_v1_create_policy_response_proto != nil { + return + } + file_com_coralogix_quota_v1_policy_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_create_policy_response_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreatePolicyResponse); 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_quota_v1_create_policy_response_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_create_policy_response_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_create_policy_response_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_create_policy_response_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_create_policy_response_proto = out.File + file_com_coralogix_quota_v1_create_policy_response_proto_rawDesc = nil + file_com_coralogix_quota_v1_create_policy_response_proto_goTypes = nil + file_com_coralogix_quota_v1_create_policy_response_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/delete_policy_request.pb.go b/coralogix/clientset/grpc/tco-policies/delete_policy_request.pb.go new file mode 100644 index 00000000..0e5122d3 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/delete_policy_request.pb.go @@ -0,0 +1,151 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/delete_policy_request.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 DeletePolicyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *DeletePolicyRequest) Reset() { + *x = DeletePolicyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_delete_policy_request_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeletePolicyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePolicyRequest) ProtoMessage() {} + +func (x *DeletePolicyRequest) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_delete_policy_request_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 DeletePolicyRequest.ProtoReflect.Descriptor instead. +func (*DeletePolicyRequest) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_delete_policy_request_proto_rawDescGZIP(), []int{0} +} + +func (x *DeletePolicyRequest) GetId() *wrapperspb.StringValue { + if x != nil { + return x.Id + } + return nil +} + +var File_com_coralogix_quota_v1_delete_policy_request_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_delete_policy_request_proto_rawDesc = []byte{ + 0x0a, 0x32, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 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, 0x43, 0x0a, 0x13, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 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, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_delete_policy_request_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_delete_policy_request_proto_rawDescData = file_com_coralogix_quota_v1_delete_policy_request_proto_rawDesc +) + +func file_com_coralogix_quota_v1_delete_policy_request_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_delete_policy_request_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_delete_policy_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_delete_policy_request_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_delete_policy_request_proto_rawDescData +} + +var file_com_coralogix_quota_v1_delete_policy_request_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_delete_policy_request_proto_goTypes = []interface{}{ + (*DeletePolicyRequest)(nil), // 0: com.coralogix.quota.v1.DeletePolicyRequest + (*wrapperspb.StringValue)(nil), // 1: google.protobuf.StringValue +} +var file_com_coralogix_quota_v1_delete_policy_request_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.DeletePolicyRequest.id:type_name -> google.protobuf.StringValue + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_delete_policy_request_proto_init() } +func file_com_coralogix_quota_v1_delete_policy_request_proto_init() { + if File_com_coralogix_quota_v1_delete_policy_request_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_delete_policy_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeletePolicyRequest); 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_quota_v1_delete_policy_request_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_delete_policy_request_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_delete_policy_request_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_delete_policy_request_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_delete_policy_request_proto = out.File + file_com_coralogix_quota_v1_delete_policy_request_proto_rawDesc = nil + file_com_coralogix_quota_v1_delete_policy_request_proto_goTypes = nil + file_com_coralogix_quota_v1_delete_policy_request_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/delete_policy_response.pb.go b/coralogix/clientset/grpc/tco-policies/delete_policy_response.pb.go new file mode 100644 index 00000000..d0f49dfd --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/delete_policy_response.pb.go @@ -0,0 +1,152 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/delete_policy_response.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 DeletePolicyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *DeletePolicyResponse) Reset() { + *x = DeletePolicyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_delete_policy_response_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeletePolicyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePolicyResponse) ProtoMessage() {} + +func (x *DeletePolicyResponse) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_delete_policy_response_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 DeletePolicyResponse.ProtoReflect.Descriptor instead. +func (*DeletePolicyResponse) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_delete_policy_response_proto_rawDescGZIP(), []int{0} +} + +func (x *DeletePolicyResponse) GetId() *wrapperspb.StringValue { + if x != nil { + return x.Id + } + return nil +} + +var File_com_coralogix_quota_v1_delete_policy_response_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_delete_policy_response_proto_rawDesc = []byte{ + 0x0a, 0x33, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, + 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 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, 0x44, 0x0a, + 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_com_coralogix_quota_v1_delete_policy_response_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_delete_policy_response_proto_rawDescData = file_com_coralogix_quota_v1_delete_policy_response_proto_rawDesc +) + +func file_com_coralogix_quota_v1_delete_policy_response_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_delete_policy_response_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_delete_policy_response_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_delete_policy_response_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_delete_policy_response_proto_rawDescData +} + +var file_com_coralogix_quota_v1_delete_policy_response_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_delete_policy_response_proto_goTypes = []interface{}{ + (*DeletePolicyResponse)(nil), // 0: com.coralogix.quota.v1.DeletePolicyResponse + (*wrapperspb.StringValue)(nil), // 1: google.protobuf.StringValue +} +var file_com_coralogix_quota_v1_delete_policy_response_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.DeletePolicyResponse.id:type_name -> google.protobuf.StringValue + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_delete_policy_response_proto_init() } +func file_com_coralogix_quota_v1_delete_policy_response_proto_init() { + if File_com_coralogix_quota_v1_delete_policy_response_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_delete_policy_response_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeletePolicyResponse); 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_quota_v1_delete_policy_response_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_delete_policy_response_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_delete_policy_response_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_delete_policy_response_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_delete_policy_response_proto = out.File + file_com_coralogix_quota_v1_delete_policy_response_proto_rawDesc = nil + file_com_coralogix_quota_v1_delete_policy_response_proto_goTypes = nil + file_com_coralogix_quota_v1_delete_policy_response_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/enums.pb.go b/coralogix/clientset/grpc/tco-policies/enums.pb.go new file mode 100644 index 00000000..06e17006 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/enums.pb.go @@ -0,0 +1,338 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/enums.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 Priority int32 + +const ( + Priority_PRIORITY_TYPE_UNSPECIFIED Priority = 0 + Priority_PRIORITY_TYPE_BLOCK Priority = 1 + Priority_PRIORITY_TYPE_LOW Priority = 2 + Priority_PRIORITY_TYPE_MEDIUM Priority = 3 + Priority_PRIORITY_TYPE_HIGH Priority = 4 +) + +// Enum value maps for Priority. +var ( + Priority_name = map[int32]string{ + 0: "PRIORITY_TYPE_UNSPECIFIED", + 1: "PRIORITY_TYPE_BLOCK", + 2: "PRIORITY_TYPE_LOW", + 3: "PRIORITY_TYPE_MEDIUM", + 4: "PRIORITY_TYPE_HIGH", + } + Priority_value = map[string]int32{ + "PRIORITY_TYPE_UNSPECIFIED": 0, + "PRIORITY_TYPE_BLOCK": 1, + "PRIORITY_TYPE_LOW": 2, + "PRIORITY_TYPE_MEDIUM": 3, + "PRIORITY_TYPE_HIGH": 4, + } +) + +func (x Priority) Enum() *Priority { + p := new(Priority) + *p = x + return p +} + +func (x Priority) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Priority) Descriptor() protoreflect.EnumDescriptor { + return file_com_coralogix_quota_v1_enums_proto_enumTypes[0].Descriptor() +} + +func (Priority) Type() protoreflect.EnumType { + return &file_com_coralogix_quota_v1_enums_proto_enumTypes[0] +} + +func (x Priority) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Priority.Descriptor instead. +func (Priority) EnumDescriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_enums_proto_rawDescGZIP(), []int{0} +} + +type Severity int32 + +const ( + Severity_SEVERITY_UNSPECIFIED Severity = 0 + Severity_SEVERITY_DEBUG Severity = 1 + Severity_SEVERITY_VERBOSE Severity = 2 + Severity_SEVERITY_INFO Severity = 3 + Severity_SEVERITY_WARNING Severity = 4 + Severity_SEVERITY_ERROR Severity = 5 + Severity_SEVERITY_CRITICAL Severity = 6 +) + +// Enum value maps for Severity. +var ( + Severity_name = map[int32]string{ + 0: "SEVERITY_UNSPECIFIED", + 1: "SEVERITY_DEBUG", + 2: "SEVERITY_VERBOSE", + 3: "SEVERITY_INFO", + 4: "SEVERITY_WARNING", + 5: "SEVERITY_ERROR", + 6: "SEVERITY_CRITICAL", + } + Severity_value = map[string]int32{ + "SEVERITY_UNSPECIFIED": 0, + "SEVERITY_DEBUG": 1, + "SEVERITY_VERBOSE": 2, + "SEVERITY_INFO": 3, + "SEVERITY_WARNING": 4, + "SEVERITY_ERROR": 5, + "SEVERITY_CRITICAL": 6, + } +) + +func (x Severity) Enum() *Severity { + p := new(Severity) + *p = x + return p +} + +func (x Severity) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Severity) Descriptor() protoreflect.EnumDescriptor { + return file_com_coralogix_quota_v1_enums_proto_enumTypes[1].Descriptor() +} + +func (Severity) Type() protoreflect.EnumType { + return &file_com_coralogix_quota_v1_enums_proto_enumTypes[1] +} + +func (x Severity) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Severity.Descriptor instead. +func (Severity) EnumDescriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_enums_proto_rawDescGZIP(), []int{1} +} + +type SourceType int32 + +const ( + SourceType_SOURCE_TYPE_UNSPECIFIED SourceType = 0 + SourceType_SOURCE_TYPE_LOGS SourceType = 1 + SourceType_SOURCE_TYPE_SPANS SourceType = 2 +) + +// Enum value maps for SourceType. +var ( + SourceType_name = map[int32]string{ + 0: "SOURCE_TYPE_UNSPECIFIED", + 1: "SOURCE_TYPE_LOGS", + 2: "SOURCE_TYPE_SPANS", + } + SourceType_value = map[string]int32{ + "SOURCE_TYPE_UNSPECIFIED": 0, + "SOURCE_TYPE_LOGS": 1, + "SOURCE_TYPE_SPANS": 2, + } +) + +func (x SourceType) Enum() *SourceType { + p := new(SourceType) + *p = x + return p +} + +func (x SourceType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SourceType) Descriptor() protoreflect.EnumDescriptor { + return file_com_coralogix_quota_v1_enums_proto_enumTypes[2].Descriptor() +} + +func (SourceType) Type() protoreflect.EnumType { + return &file_com_coralogix_quota_v1_enums_proto_enumTypes[2] +} + +func (x SourceType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SourceType.Descriptor instead. +func (SourceType) EnumDescriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_enums_proto_rawDescGZIP(), []int{2} +} + +type RuleTypeId int32 + +const ( + RuleTypeId_RULE_TYPE_ID_UNSPECIFIED RuleTypeId = 0 + RuleTypeId_RULE_TYPE_ID_IS RuleTypeId = 2 + RuleTypeId_RULE_TYPE_ID_IS_NOT RuleTypeId = 3 + RuleTypeId_RULE_TYPE_ID_START_WITH RuleTypeId = 4 + RuleTypeId_RULE_TYPE_ID_INCLUDES RuleTypeId = 6 +) + +// Enum value maps for RuleTypeId. +var ( + RuleTypeId_name = map[int32]string{ + 0: "RULE_TYPE_ID_UNSPECIFIED", + 2: "RULE_TYPE_ID_IS", + 3: "RULE_TYPE_ID_IS_NOT", + 4: "RULE_TYPE_ID_START_WITH", + 6: "RULE_TYPE_ID_INCLUDES", + } + RuleTypeId_value = map[string]int32{ + "RULE_TYPE_ID_UNSPECIFIED": 0, + "RULE_TYPE_ID_IS": 2, + "RULE_TYPE_ID_IS_NOT": 3, + "RULE_TYPE_ID_START_WITH": 4, + "RULE_TYPE_ID_INCLUDES": 6, + } +) + +func (x RuleTypeId) Enum() *RuleTypeId { + p := new(RuleTypeId) + *p = x + return p +} + +func (x RuleTypeId) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RuleTypeId) Descriptor() protoreflect.EnumDescriptor { + return file_com_coralogix_quota_v1_enums_proto_enumTypes[3].Descriptor() +} + +func (RuleTypeId) Type() protoreflect.EnumType { + return &file_com_coralogix_quota_v1_enums_proto_enumTypes[3] +} + +func (x RuleTypeId) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RuleTypeId.Descriptor instead. +func (RuleTypeId) EnumDescriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_enums_proto_rawDescGZIP(), []int{3} +} + +var File_com_coralogix_quota_v1_enums_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_enums_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2a, 0x8b, 0x01, 0x0a, + 0x08, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x19, 0x50, 0x52, 0x49, + 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x50, 0x52, 0x49, 0x4f, + 0x52, 0x49, 0x54, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, + 0x01, 0x12, 0x15, 0x0a, 0x11, 0x50, 0x52, 0x49, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x57, 0x10, 0x02, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x52, 0x49, 0x4f, + 0x52, 0x49, 0x54, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x44, 0x49, 0x55, 0x4d, + 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x50, 0x52, 0x49, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x48, 0x49, 0x47, 0x48, 0x10, 0x04, 0x2a, 0xa2, 0x01, 0x0a, 0x08, 0x53, + 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x45, 0x56, 0x45, 0x52, + 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x44, 0x45, + 0x42, 0x55, 0x47, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, + 0x59, 0x5f, 0x56, 0x45, 0x52, 0x42, 0x4f, 0x53, 0x45, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x53, + 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x03, 0x12, 0x14, + 0x0a, 0x10, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x49, + 0x4e, 0x47, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x45, 0x56, 0x45, 0x52, 0x49, 0x54, 0x59, + 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x45, 0x56, 0x45, + 0x52, 0x49, 0x54, 0x59, 0x5f, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4c, 0x10, 0x06, 0x2a, + 0x56, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, + 0x17, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x4f, + 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x47, 0x53, 0x10, 0x01, + 0x12, 0x15, 0x0a, 0x11, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x53, 0x50, 0x41, 0x4e, 0x53, 0x10, 0x02, 0x2a, 0xa2, 0x01, 0x0a, 0x0a, 0x52, 0x75, 0x6c, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x55, 0x4c, 0x45, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x55, 0x4c, 0x45, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x49, 0x53, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x52, 0x55, 0x4c, + 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x49, 0x53, 0x5f, 0x4e, 0x4f, 0x54, + 0x10, 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x55, 0x4c, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x49, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x10, 0x04, 0x12, + 0x19, 0x0a, 0x15, 0x52, 0x55, 0x4c, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x44, 0x5f, + 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x45, 0x53, 0x10, 0x06, 0x22, 0x04, 0x08, 0x01, 0x10, 0x01, + 0x22, 0x04, 0x08, 0x05, 0x10, 0x05, 0x22, 0x04, 0x08, 0x07, 0x10, 0x07, 0x42, 0x04, 0x5a, 0x02, + 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_enums_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_enums_proto_rawDescData = file_com_coralogix_quota_v1_enums_proto_rawDesc +) + +func file_com_coralogix_quota_v1_enums_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_enums_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_enums_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_enums_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_enums_proto_rawDescData +} + +var file_com_coralogix_quota_v1_enums_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_com_coralogix_quota_v1_enums_proto_goTypes = []interface{}{ + (Priority)(0), // 0: com.coralogix.quota.v1.Priority + (Severity)(0), // 1: com.coralogix.quota.v1.Severity + (SourceType)(0), // 2: com.coralogix.quota.v1.SourceType + (RuleTypeId)(0), // 3: com.coralogix.quota.v1.RuleTypeId +} +var file_com_coralogix_quota_v1_enums_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_enums_proto_init() } +func file_com_coralogix_quota_v1_enums_proto_init() { + if File_com_coralogix_quota_v1_enums_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_com_coralogix_quota_v1_enums_proto_rawDesc, + NumEnums: 4, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_enums_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_enums_proto_depIdxs, + EnumInfos: file_com_coralogix_quota_v1_enums_proto_enumTypes, + }.Build() + File_com_coralogix_quota_v1_enums_proto = out.File + file_com_coralogix_quota_v1_enums_proto_rawDesc = nil + file_com_coralogix_quota_v1_enums_proto_goTypes = nil + file_com_coralogix_quota_v1_enums_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/get_company_policies_request.pb.go b/coralogix/clientset/grpc/tco-policies/get_company_policies_request.pb.go new file mode 100644 index 00000000..0ebf3c04 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/get_company_policies_request.pb.go @@ -0,0 +1,173 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/get_company_policies_request.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 GetCompanyPoliciesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EnabledOnly *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=enabled_only,json=enabledOnly,proto3" json:"enabled_only,omitempty"` + SourceType *SourceType `protobuf:"varint,2,opt,name=source_type,json=sourceType,proto3,enum=com.coralogix.quota.v1.SourceType,oneof" json:"source_type,omitempty"` +} + +func (x *GetCompanyPoliciesRequest) Reset() { + *x = GetCompanyPoliciesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_get_company_policies_request_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCompanyPoliciesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCompanyPoliciesRequest) ProtoMessage() {} + +func (x *GetCompanyPoliciesRequest) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_get_company_policies_request_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 GetCompanyPoliciesRequest.ProtoReflect.Descriptor instead. +func (*GetCompanyPoliciesRequest) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_get_company_policies_request_proto_rawDescGZIP(), []int{0} +} + +func (x *GetCompanyPoliciesRequest) GetEnabledOnly() *wrapperspb.BoolValue { + if x != nil { + return x.EnabledOnly + } + return nil +} + +func (x *GetCompanyPoliciesRequest) GetSourceType() SourceType { + if x != nil && x.SourceType != nil { + return *x.SourceType + } + return SourceType_SOURCE_TYPE_UNSPECIFIED +} + +var File_com_coralogix_quota_v1_get_company_policies_request_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_get_company_policies_request_proto_rawDesc = []byte{ + 0x0a, 0x39, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5f, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, + 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, 0x22, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x75, 0x6d, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb4, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x43, + 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x0c, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 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, 0x0b, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x48, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, + 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0e, + 0x0a, 0x0c, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x04, + 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_get_company_policies_request_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_get_company_policies_request_proto_rawDescData = file_com_coralogix_quota_v1_get_company_policies_request_proto_rawDesc +) + +func file_com_coralogix_quota_v1_get_company_policies_request_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_get_company_policies_request_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_get_company_policies_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_get_company_policies_request_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_get_company_policies_request_proto_rawDescData +} + +var file_com_coralogix_quota_v1_get_company_policies_request_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_get_company_policies_request_proto_goTypes = []interface{}{ + (*GetCompanyPoliciesRequest)(nil), // 0: com.coralogix.quota.v1.GetCompanyPoliciesRequest + (*wrapperspb.BoolValue)(nil), // 1: google.protobuf.BoolValue + (SourceType)(0), // 2: com.coralogix.quota.v1.SourceType +} +var file_com_coralogix_quota_v1_get_company_policies_request_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.GetCompanyPoliciesRequest.enabled_only:type_name -> google.protobuf.BoolValue + 2, // 1: com.coralogix.quota.v1.GetCompanyPoliciesRequest.source_type:type_name -> com.coralogix.quota.v1.SourceType + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_get_company_policies_request_proto_init() } +func file_com_coralogix_quota_v1_get_company_policies_request_proto_init() { + if File_com_coralogix_quota_v1_get_company_policies_request_proto != nil { + return + } + file_com_coralogix_quota_v1_enums_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_get_company_policies_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCompanyPoliciesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_com_coralogix_quota_v1_get_company_policies_request_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_com_coralogix_quota_v1_get_company_policies_request_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_get_company_policies_request_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_get_company_policies_request_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_get_company_policies_request_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_get_company_policies_request_proto = out.File + file_com_coralogix_quota_v1_get_company_policies_request_proto_rawDesc = nil + file_com_coralogix_quota_v1_get_company_policies_request_proto_goTypes = nil + file_com_coralogix_quota_v1_get_company_policies_request_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/get_company_policies_response.pb.go b/coralogix/clientset/grpc/tco-policies/get_company_policies_response.pb.go new file mode 100644 index 00000000..b03426a2 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/get_company_policies_response.pb.go @@ -0,0 +1,154 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/get_company_policies_response.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 GetCompanyPoliciesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Policies []*Policy `protobuf:"bytes,1,rep,name=policies,proto3" json:"policies,omitempty"` +} + +func (x *GetCompanyPoliciesResponse) Reset() { + *x = GetCompanyPoliciesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_get_company_policies_response_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCompanyPoliciesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCompanyPoliciesResponse) ProtoMessage() {} + +func (x *GetCompanyPoliciesResponse) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_get_company_policies_response_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 GetCompanyPoliciesResponse.ProtoReflect.Descriptor instead. +func (*GetCompanyPoliciesResponse) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_get_company_policies_response_proto_rawDescGZIP(), []int{0} +} + +func (x *GetCompanyPoliciesResponse) GetPolicies() []*Policy { + if x != nil { + return x.Policies + } + return nil +} + +var File_com_coralogix_quota_v1_get_company_policies_response_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_get_company_policies_response_proto_rawDesc = []byte{ + 0x0a, 0x3a, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x6d, + 0x70, 0x61, 0x6e, 0x79, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5f, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, + 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, + 0x61, 0x2e, 0x76, 0x31, 0x1a, 0x23, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x58, 0x0a, 0x1a, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, + 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, + 0x69, 0x65, 0x73, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_com_coralogix_quota_v1_get_company_policies_response_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_get_company_policies_response_proto_rawDescData = file_com_coralogix_quota_v1_get_company_policies_response_proto_rawDesc +) + +func file_com_coralogix_quota_v1_get_company_policies_response_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_get_company_policies_response_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_get_company_policies_response_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_get_company_policies_response_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_get_company_policies_response_proto_rawDescData +} + +var file_com_coralogix_quota_v1_get_company_policies_response_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_get_company_policies_response_proto_goTypes = []interface{}{ + (*GetCompanyPoliciesResponse)(nil), // 0: com.coralogix.quota.v1.GetCompanyPoliciesResponse + (*Policy)(nil), // 1: com.coralogix.quota.v1.Policy +} +var file_com_coralogix_quota_v1_get_company_policies_response_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.GetCompanyPoliciesResponse.policies:type_name -> com.coralogix.quota.v1.Policy + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_get_company_policies_response_proto_init() } +func file_com_coralogix_quota_v1_get_company_policies_response_proto_init() { + if File_com_coralogix_quota_v1_get_company_policies_response_proto != nil { + return + } + file_com_coralogix_quota_v1_policy_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_get_company_policies_response_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCompanyPoliciesResponse); 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_quota_v1_get_company_policies_response_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_get_company_policies_response_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_get_company_policies_response_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_get_company_policies_response_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_get_company_policies_response_proto = out.File + file_com_coralogix_quota_v1_get_company_policies_response_proto_rawDesc = nil + file_com_coralogix_quota_v1_get_company_policies_response_proto_goTypes = nil + file_com_coralogix_quota_v1_get_company_policies_response_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/get_policy_request.pb.go b/coralogix/clientset/grpc/tco-policies/get_policy_request.pb.go new file mode 100644 index 00000000..a1f32cfa --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/get_policy_request.pb.go @@ -0,0 +1,151 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/get_policy_request.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 GetPolicyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetPolicyRequest) Reset() { + *x = GetPolicyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_get_policy_request_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPolicyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPolicyRequest) ProtoMessage() {} + +func (x *GetPolicyRequest) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_get_policy_request_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 GetPolicyRequest.ProtoReflect.Descriptor instead. +func (*GetPolicyRequest) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_get_policy_request_proto_rawDescGZIP(), []int{0} +} + +func (x *GetPolicyRequest) GetId() *wrapperspb.StringValue { + if x != nil { + return x.Id + } + return nil +} + +var File_com_coralogix_quota_v1_get_policy_request_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_get_policy_request_proto_rawDesc = []byte{ + 0x0a, 0x2f, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, + 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 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, 0x40, 0x0a, 0x10, 0x47, 0x65, 0x74, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x42, 0x04, 0x5a, 0x02, 0x2e, + 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_get_policy_request_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_get_policy_request_proto_rawDescData = file_com_coralogix_quota_v1_get_policy_request_proto_rawDesc +) + +func file_com_coralogix_quota_v1_get_policy_request_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_get_policy_request_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_get_policy_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_get_policy_request_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_get_policy_request_proto_rawDescData +} + +var file_com_coralogix_quota_v1_get_policy_request_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_get_policy_request_proto_goTypes = []interface{}{ + (*GetPolicyRequest)(nil), // 0: com.coralogix.quota.v1.GetPolicyRequest + (*wrapperspb.StringValue)(nil), // 1: google.protobuf.StringValue +} +var file_com_coralogix_quota_v1_get_policy_request_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.GetPolicyRequest.id:type_name -> google.protobuf.StringValue + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_get_policy_request_proto_init() } +func file_com_coralogix_quota_v1_get_policy_request_proto_init() { + if File_com_coralogix_quota_v1_get_policy_request_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_get_policy_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPolicyRequest); 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_quota_v1_get_policy_request_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_get_policy_request_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_get_policy_request_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_get_policy_request_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_get_policy_request_proto = out.File + file_com_coralogix_quota_v1_get_policy_request_proto_rawDesc = nil + file_com_coralogix_quota_v1_get_policy_request_proto_goTypes = nil + file_com_coralogix_quota_v1_get_policy_request_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/get_policy_response.pb.go b/coralogix/clientset/grpc/tco-policies/get_policy_response.pb.go new file mode 100644 index 00000000..c140827a --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/get_policy_response.pb.go @@ -0,0 +1,152 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/get_policy_response.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 GetPolicyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Policy *Policy `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy,omitempty"` +} + +func (x *GetPolicyResponse) Reset() { + *x = GetPolicyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_get_policy_response_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPolicyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPolicyResponse) ProtoMessage() {} + +func (x *GetPolicyResponse) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_get_policy_response_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 GetPolicyResponse.ProtoReflect.Descriptor instead. +func (*GetPolicyResponse) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_get_policy_response_proto_rawDescGZIP(), []int{0} +} + +func (x *GetPolicyResponse) GetPolicy() *Policy { + if x != nil { + return x.Policy + } + return nil +} + +var File_com_coralogix_quota_v1_get_policy_response_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_get_policy_response_proto_rawDesc = []byte{ + 0x0a, 0x30, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, + 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x1a, 0x23, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, + 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x4b, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, + 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x04, 0x5a, 0x02, + 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_get_policy_response_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_get_policy_response_proto_rawDescData = file_com_coralogix_quota_v1_get_policy_response_proto_rawDesc +) + +func file_com_coralogix_quota_v1_get_policy_response_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_get_policy_response_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_get_policy_response_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_get_policy_response_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_get_policy_response_proto_rawDescData +} + +var file_com_coralogix_quota_v1_get_policy_response_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_get_policy_response_proto_goTypes = []interface{}{ + (*GetPolicyResponse)(nil), // 0: com.coralogix.quota.v1.GetPolicyResponse + (*Policy)(nil), // 1: com.coralogix.quota.v1.Policy +} +var file_com_coralogix_quota_v1_get_policy_response_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.GetPolicyResponse.policy:type_name -> com.coralogix.quota.v1.Policy + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_get_policy_response_proto_init() } +func file_com_coralogix_quota_v1_get_policy_response_proto_init() { + if File_com_coralogix_quota_v1_get_policy_response_proto != nil { + return + } + file_com_coralogix_quota_v1_policy_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_get_policy_response_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPolicyResponse); 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_quota_v1_get_policy_response_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_get_policy_response_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_get_policy_response_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_get_policy_response_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_get_policy_response_proto = out.File + file_com_coralogix_quota_v1_get_policy_response_proto_rawDesc = nil + file_com_coralogix_quota_v1_get_policy_response_proto_goTypes = nil + file_com_coralogix_quota_v1_get_policy_response_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/log_meta_field_values.pb.go b/coralogix/clientset/grpc/tco-policies/log_meta_field_values.pb.go new file mode 100644 index 00000000..d0ac0355 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/log_meta_field_values.pb.go @@ -0,0 +1,182 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/log_meta_field_values.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 LogMetaFieldsValues struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApplicationNameValues *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=application_name_values,json=applicationNameValues,proto3" json:"application_name_values,omitempty"` + SeverityValues *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=severity_values,json=severityValues,proto3" json:"severity_values,omitempty"` + SubsystemNameValues *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=subsystem_name_values,json=subsystemNameValues,proto3" json:"subsystem_name_values,omitempty"` +} + +func (x *LogMetaFieldsValues) Reset() { + *x = LogMetaFieldsValues{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_log_meta_field_values_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogMetaFieldsValues) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogMetaFieldsValues) ProtoMessage() {} + +func (x *LogMetaFieldsValues) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_log_meta_field_values_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 LogMetaFieldsValues.ProtoReflect.Descriptor instead. +func (*LogMetaFieldsValues) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_log_meta_field_values_proto_rawDescGZIP(), []int{0} +} + +func (x *LogMetaFieldsValues) GetApplicationNameValues() *wrapperspb.StringValue { + if x != nil { + return x.ApplicationNameValues + } + return nil +} + +func (x *LogMetaFieldsValues) GetSeverityValues() *wrapperspb.StringValue { + if x != nil { + return x.SeverityValues + } + return nil +} + +func (x *LogMetaFieldsValues) GetSubsystemNameValues() *wrapperspb.StringValue { + if x != nil { + return x.SubsystemNameValues + } + return nil +} + +var File_com_coralogix_quota_v1_log_meta_field_values_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_log_meta_field_values_proto_rawDesc = []byte{ + 0x0a, 0x32, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x5f, 0x6d, 0x65, 0x74, + 0x61, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 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, 0x84, 0x02, 0x0a, + 0x13, 0x4c, 0x6f, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x12, 0x54, 0x0a, 0x17, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 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, 0x15, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4e, 0x61, 0x6d, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x0f, 0x73, 0x65, + 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 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, 0x52, 0x0e, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x50, 0x0a, 0x15, 0x73, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 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, 0x13, + 0x73, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_com_coralogix_quota_v1_log_meta_field_values_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_log_meta_field_values_proto_rawDescData = file_com_coralogix_quota_v1_log_meta_field_values_proto_rawDesc +) + +func file_com_coralogix_quota_v1_log_meta_field_values_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_log_meta_field_values_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_log_meta_field_values_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_log_meta_field_values_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_log_meta_field_values_proto_rawDescData +} + +var file_com_coralogix_quota_v1_log_meta_field_values_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_log_meta_field_values_proto_goTypes = []interface{}{ + (*LogMetaFieldsValues)(nil), // 0: com.coralogix.quota.v1.LogMetaFieldsValues + (*wrapperspb.StringValue)(nil), // 1: google.protobuf.StringValue +} +var file_com_coralogix_quota_v1_log_meta_field_values_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.LogMetaFieldsValues.application_name_values:type_name -> google.protobuf.StringValue + 1, // 1: com.coralogix.quota.v1.LogMetaFieldsValues.severity_values:type_name -> google.protobuf.StringValue + 1, // 2: com.coralogix.quota.v1.LogMetaFieldsValues.subsystem_name_values:type_name -> google.protobuf.StringValue + 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_quota_v1_log_meta_field_values_proto_init() } +func file_com_coralogix_quota_v1_log_meta_field_values_proto_init() { + if File_com_coralogix_quota_v1_log_meta_field_values_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_log_meta_field_values_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogMetaFieldsValues); 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_quota_v1_log_meta_field_values_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_log_meta_field_values_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_log_meta_field_values_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_log_meta_field_values_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_log_meta_field_values_proto = out.File + file_com_coralogix_quota_v1_log_meta_field_values_proto_rawDesc = nil + file_com_coralogix_quota_v1_log_meta_field_values_proto_goTypes = nil + file_com_coralogix_quota_v1_log_meta_field_values_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/log_rules.pb.go b/coralogix/clientset/grpc/tco-policies/log_rules.pb.go new file mode 100644 index 00000000..96955df5 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/log_rules.pb.go @@ -0,0 +1,151 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/log_rules.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 LogRules struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Severities []Severity `protobuf:"varint,1,rep,packed,name=severities,proto3,enum=com.coralogix.quota.v1.Severity" json:"severities,omitempty"` +} + +func (x *LogRules) Reset() { + *x = LogRules{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_log_rules_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogRules) ProtoMessage() {} + +func (x *LogRules) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_log_rules_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 LogRules.ProtoReflect.Descriptor instead. +func (*LogRules) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_log_rules_proto_rawDescGZIP(), []int{0} +} + +func (x *LogRules) GetSeverities() []Severity { + if x != nil { + return x.Severities + } + return nil +} + +var File_com_coralogix_quota_v1_log_rules_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_log_rules_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x5f, 0x72, 0x75, 0x6c, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, + 0x1a, 0x22, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4c, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, + 0x12, 0x40, 0x0a, 0x0a, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, + 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, + 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x69, + 0x65, 0x73, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_log_rules_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_log_rules_proto_rawDescData = file_com_coralogix_quota_v1_log_rules_proto_rawDesc +) + +func file_com_coralogix_quota_v1_log_rules_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_log_rules_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_log_rules_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_log_rules_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_log_rules_proto_rawDescData +} + +var file_com_coralogix_quota_v1_log_rules_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_log_rules_proto_goTypes = []interface{}{ + (*LogRules)(nil), // 0: com.coralogix.quota.v1.LogRules + (Severity)(0), // 1: com.coralogix.quota.v1.Severity +} +var file_com_coralogix_quota_v1_log_rules_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.LogRules.severities:type_name -> com.coralogix.quota.v1.Severity + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_log_rules_proto_init() } +func file_com_coralogix_quota_v1_log_rules_proto_init() { + if File_com_coralogix_quota_v1_log_rules_proto != nil { + return + } + file_com_coralogix_quota_v1_enums_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_log_rules_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogRules); 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_quota_v1_log_rules_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_log_rules_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_log_rules_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_log_rules_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_log_rules_proto = out.File + file_com_coralogix_quota_v1_log_rules_proto_rawDesc = nil + file_com_coralogix_quota_v1_log_rules_proto_goTypes = nil + file_com_coralogix_quota_v1_log_rules_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/policies_service.pb.go b/coralogix/clientset/grpc/tco-policies/policies_service.pb.go new file mode 100644 index 00000000..79e0e203 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/policies_service.pb.go @@ -0,0 +1,240 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/policies_service.proto + +package __ + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +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) +) + +var File_com_coralogix_quota_v1_policies_service_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_policies_service_proto_rawDesc = []byte{ + 0x0a, 0x2d, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, + 0x73, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, + 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x1a, 0x26, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, + 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, + 0x61, 0x75, 0x64, 0x69, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x2f, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, + 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x30, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x32, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, + 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x33, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, + 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x32, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, + 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x33, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, + 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x39, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, + 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, + 0x73, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x3a, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, + 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, + 0x61, 0x6e, 0x79, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x32, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, + 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x33, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, + 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x35, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5f, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x36, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, + 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x6c, 0x69, + 0x63, 0x69, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x3b, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x75, 0x6c, 0x6b, + 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, + 0x65, 0x73, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x3c, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x75, 0x6c, 0x6b, 0x5f, 0x74, 0x65, + 0x73, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5f, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x32, + 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, + 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x5f, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x33, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, + 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6f, 0x67, 0x67, 0x6c, + 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xcb, 0x08, 0x0a, 0x0f, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x69, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x72, 0x0a, 0x09, 0x47, + 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, + 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x10, 0xc2, + 0xb8, 0x02, 0x0c, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x20, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, + 0x7e, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, + 0x2b, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, + 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0xc2, 0xb8, 0x02, 0x0f, + 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, + 0x7e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, + 0x2b, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, + 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0xc2, 0xb8, 0x02, 0x0f, + 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, + 0x97, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, + 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, + 0x65, 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, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x50, 0x6f, 0x6c, + 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0xc2, + 0xb8, 0x02, 0x16, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, + 0x20, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x7e, 0x0a, 0x0c, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, + 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, + 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0xc2, 0xb8, 0x02, 0x0f, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x20, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x8a, 0x01, 0x0a, 0x0f, 0x52, 0x65, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x2e, 0x2e, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, + 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x69, 0x65, 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, 0x71, 0x75, + 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, + 0xc2, 0xb8, 0x02, 0x12, 0x0a, 0x10, 0x52, 0x65, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x20, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x9c, 0x01, 0x0a, 0x13, 0x42, 0x75, 0x6c, 0x6b, 0x54, + 0x65, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x32, + 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, + 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x54, 0x65, 0x73, 0x74, + 0x4c, 0x6f, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x6c, 0x6b, + 0x54, 0x65, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0xc2, 0xb8, 0x02, 0x18, 0x0a, 0x16, 0x42, + 0x75, 0x6c, 0x6b, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x4c, 0x6f, 0x67, 0x20, 0x50, 0x6f, 0x6c, + 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x7e, 0x0a, 0x0c, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, + 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x54, + 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x67, 0x67, + 0x6c, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x13, 0xc2, 0xb8, 0x02, 0x0f, 0x0a, 0x0d, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x20, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var file_com_coralogix_quota_v1_policies_service_proto_goTypes = []interface{}{ + (*GetPolicyRequest)(nil), // 0: com.coralogix.quota.v1.GetPolicyRequest + (*CreatePolicyRequest)(nil), // 1: com.coralogix.quota.v1.CreatePolicyRequest + (*UpdatePolicyRequest)(nil), // 2: com.coralogix.quota.v1.UpdatePolicyRequest + (*GetCompanyPoliciesRequest)(nil), // 3: com.coralogix.quota.v1.GetCompanyPoliciesRequest + (*DeletePolicyRequest)(nil), // 4: com.coralogix.quota.v1.DeletePolicyRequest + (*ReorderPoliciesRequest)(nil), // 5: com.coralogix.quota.v1.ReorderPoliciesRequest + (*BulkTestLogPoliciesRequest)(nil), // 6: com.coralogix.quota.v1.BulkTestLogPoliciesRequest + (*TogglePolicyRequest)(nil), // 7: com.coralogix.quota.v1.TogglePolicyRequest + (*GetPolicyResponse)(nil), // 8: com.coralogix.quota.v1.GetPolicyResponse + (*CreatePolicyResponse)(nil), // 9: com.coralogix.quota.v1.CreatePolicyResponse + (*UpdatePolicyResponse)(nil), // 10: com.coralogix.quota.v1.UpdatePolicyResponse + (*GetCompanyPoliciesResponse)(nil), // 11: com.coralogix.quota.v1.GetCompanyPoliciesResponse + (*DeletePolicyResponse)(nil), // 12: com.coralogix.quota.v1.DeletePolicyResponse + (*ReorderPoliciesResponse)(nil), // 13: com.coralogix.quota.v1.ReorderPoliciesResponse + (*BulkTestLogPoliciesResponse)(nil), // 14: com.coralogix.quota.v1.BulkTestLogPoliciesResponse + (*TogglePolicyResponse)(nil), // 15: com.coralogix.quota.v1.TogglePolicyResponse +} +var file_com_coralogix_quota_v1_policies_service_proto_depIdxs = []int32{ + 0, // 0: com.coralogix.quota.v1.PoliciesService.GetPolicy:input_type -> com.coralogix.quota.v1.GetPolicyRequest + 1, // 1: com.coralogix.quota.v1.PoliciesService.CreatePolicy:input_type -> com.coralogix.quota.v1.CreatePolicyRequest + 2, // 2: com.coralogix.quota.v1.PoliciesService.UpdatePolicy:input_type -> com.coralogix.quota.v1.UpdatePolicyRequest + 3, // 3: com.coralogix.quota.v1.PoliciesService.GetCompanyPolicies:input_type -> com.coralogix.quota.v1.GetCompanyPoliciesRequest + 4, // 4: com.coralogix.quota.v1.PoliciesService.DeletePolicy:input_type -> com.coralogix.quota.v1.DeletePolicyRequest + 5, // 5: com.coralogix.quota.v1.PoliciesService.ReorderPolicies:input_type -> com.coralogix.quota.v1.ReorderPoliciesRequest + 6, // 6: com.coralogix.quota.v1.PoliciesService.BulkTestLogPolicies:input_type -> com.coralogix.quota.v1.BulkTestLogPoliciesRequest + 7, // 7: com.coralogix.quota.v1.PoliciesService.TogglePolicy:input_type -> com.coralogix.quota.v1.TogglePolicyRequest + 8, // 8: com.coralogix.quota.v1.PoliciesService.GetPolicy:output_type -> com.coralogix.quota.v1.GetPolicyResponse + 9, // 9: com.coralogix.quota.v1.PoliciesService.CreatePolicy:output_type -> com.coralogix.quota.v1.CreatePolicyResponse + 10, // 10: com.coralogix.quota.v1.PoliciesService.UpdatePolicy:output_type -> com.coralogix.quota.v1.UpdatePolicyResponse + 11, // 11: com.coralogix.quota.v1.PoliciesService.GetCompanyPolicies:output_type -> com.coralogix.quota.v1.GetCompanyPoliciesResponse + 12, // 12: com.coralogix.quota.v1.PoliciesService.DeletePolicy:output_type -> com.coralogix.quota.v1.DeletePolicyResponse + 13, // 13: com.coralogix.quota.v1.PoliciesService.ReorderPolicies:output_type -> com.coralogix.quota.v1.ReorderPoliciesResponse + 14, // 14: com.coralogix.quota.v1.PoliciesService.BulkTestLogPolicies:output_type -> com.coralogix.quota.v1.BulkTestLogPoliciesResponse + 15, // 15: com.coralogix.quota.v1.PoliciesService.TogglePolicy:output_type -> com.coralogix.quota.v1.TogglePolicyResponse + 8, // [8:16] is the sub-list for method output_type + 0, // [0:8] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_policies_service_proto_init() } +func file_com_coralogix_quota_v1_policies_service_proto_init() { + if File_com_coralogix_quota_v1_policies_service_proto != nil { + return + } + file_com_coralogix_quota_v1_audit_log_proto_init() + file_com_coralogix_quota_v1_get_policy_request_proto_init() + file_com_coralogix_quota_v1_get_policy_response_proto_init() + file_com_coralogix_quota_v1_create_policy_request_proto_init() + file_com_coralogix_quota_v1_create_policy_response_proto_init() + file_com_coralogix_quota_v1_update_policy_request_proto_init() + file_com_coralogix_quota_v1_update_policy_response_proto_init() + file_com_coralogix_quota_v1_get_company_policies_request_proto_init() + file_com_coralogix_quota_v1_get_company_policies_response_proto_init() + file_com_coralogix_quota_v1_delete_policy_request_proto_init() + file_com_coralogix_quota_v1_delete_policy_response_proto_init() + file_com_coralogix_quota_v1_reorder_policies_request_proto_init() + file_com_coralogix_quota_v1_reorder_policies_response_proto_init() + file_com_coralogix_quota_v1_bulk_test_log_policies_request_proto_init() + file_com_coralogix_quota_v1_bulk_test_log_policies_response_proto_init() + file_com_coralogix_quota_v1_toggle_policy_request_proto_init() + file_com_coralogix_quota_v1_toggle_policy_response_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_com_coralogix_quota_v1_policies_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_com_coralogix_quota_v1_policies_service_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_policies_service_proto_depIdxs, + }.Build() + File_com_coralogix_quota_v1_policies_service_proto = out.File + file_com_coralogix_quota_v1_policies_service_proto_rawDesc = nil + file_com_coralogix_quota_v1_policies_service_proto_goTypes = nil + file_com_coralogix_quota_v1_policies_service_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/policies_service_grpc.pb.go b/coralogix/clientset/grpc/tco-policies/policies_service_grpc.pb.go new file mode 100644 index 00000000..ba3b5465 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/policies_service_grpc.pb.go @@ -0,0 +1,357 @@ +// 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/quota/v1/policies_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 + +// PoliciesServiceClient is the client API for PoliciesService 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 PoliciesServiceClient interface { + GetPolicy(ctx context.Context, in *GetPolicyRequest, opts ...grpc.CallOption) (*GetPolicyResponse, error) + CreatePolicy(ctx context.Context, in *CreatePolicyRequest, opts ...grpc.CallOption) (*CreatePolicyResponse, error) + UpdatePolicy(ctx context.Context, in *UpdatePolicyRequest, opts ...grpc.CallOption) (*UpdatePolicyResponse, error) + GetCompanyPolicies(ctx context.Context, in *GetCompanyPoliciesRequest, opts ...grpc.CallOption) (*GetCompanyPoliciesResponse, error) + DeletePolicy(ctx context.Context, in *DeletePolicyRequest, opts ...grpc.CallOption) (*DeletePolicyResponse, error) + ReorderPolicies(ctx context.Context, in *ReorderPoliciesRequest, opts ...grpc.CallOption) (*ReorderPoliciesResponse, error) + BulkTestLogPolicies(ctx context.Context, in *BulkTestLogPoliciesRequest, opts ...grpc.CallOption) (*BulkTestLogPoliciesResponse, error) + TogglePolicy(ctx context.Context, in *TogglePolicyRequest, opts ...grpc.CallOption) (*TogglePolicyResponse, error) +} + +type policiesServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewPoliciesServiceClient(cc grpc.ClientConnInterface) PoliciesServiceClient { + return &policiesServiceClient{cc} +} + +func (c *policiesServiceClient) GetPolicy(ctx context.Context, in *GetPolicyRequest, opts ...grpc.CallOption) (*GetPolicyResponse, error) { + out := new(GetPolicyResponse) + err := c.cc.Invoke(ctx, "/com.coralogix.quota.v1.PoliciesService/GetPolicy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *policiesServiceClient) CreatePolicy(ctx context.Context, in *CreatePolicyRequest, opts ...grpc.CallOption) (*CreatePolicyResponse, error) { + out := new(CreatePolicyResponse) + err := c.cc.Invoke(ctx, "/com.coralogix.quota.v1.PoliciesService/CreatePolicy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *policiesServiceClient) UpdatePolicy(ctx context.Context, in *UpdatePolicyRequest, opts ...grpc.CallOption) (*UpdatePolicyResponse, error) { + out := new(UpdatePolicyResponse) + err := c.cc.Invoke(ctx, "/com.coralogix.quota.v1.PoliciesService/UpdatePolicy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *policiesServiceClient) GetCompanyPolicies(ctx context.Context, in *GetCompanyPoliciesRequest, opts ...grpc.CallOption) (*GetCompanyPoliciesResponse, error) { + out := new(GetCompanyPoliciesResponse) + err := c.cc.Invoke(ctx, "/com.coralogix.quota.v1.PoliciesService/GetCompanyPolicies", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *policiesServiceClient) DeletePolicy(ctx context.Context, in *DeletePolicyRequest, opts ...grpc.CallOption) (*DeletePolicyResponse, error) { + out := new(DeletePolicyResponse) + err := c.cc.Invoke(ctx, "/com.coralogix.quota.v1.PoliciesService/DeletePolicy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *policiesServiceClient) ReorderPolicies(ctx context.Context, in *ReorderPoliciesRequest, opts ...grpc.CallOption) (*ReorderPoliciesResponse, error) { + out := new(ReorderPoliciesResponse) + err := c.cc.Invoke(ctx, "/com.coralogix.quota.v1.PoliciesService/ReorderPolicies", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *policiesServiceClient) BulkTestLogPolicies(ctx context.Context, in *BulkTestLogPoliciesRequest, opts ...grpc.CallOption) (*BulkTestLogPoliciesResponse, error) { + out := new(BulkTestLogPoliciesResponse) + err := c.cc.Invoke(ctx, "/com.coralogix.quota.v1.PoliciesService/BulkTestLogPolicies", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *policiesServiceClient) TogglePolicy(ctx context.Context, in *TogglePolicyRequest, opts ...grpc.CallOption) (*TogglePolicyResponse, error) { + out := new(TogglePolicyResponse) + err := c.cc.Invoke(ctx, "/com.coralogix.quota.v1.PoliciesService/TogglePolicy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PoliciesServiceServer is the server API for PoliciesService service. +// All implementations must embed UnimplementedPoliciesServiceServer +// for forward compatibility +type PoliciesServiceServer interface { + GetPolicy(context.Context, *GetPolicyRequest) (*GetPolicyResponse, error) + CreatePolicy(context.Context, *CreatePolicyRequest) (*CreatePolicyResponse, error) + UpdatePolicy(context.Context, *UpdatePolicyRequest) (*UpdatePolicyResponse, error) + GetCompanyPolicies(context.Context, *GetCompanyPoliciesRequest) (*GetCompanyPoliciesResponse, error) + DeletePolicy(context.Context, *DeletePolicyRequest) (*DeletePolicyResponse, error) + ReorderPolicies(context.Context, *ReorderPoliciesRequest) (*ReorderPoliciesResponse, error) + BulkTestLogPolicies(context.Context, *BulkTestLogPoliciesRequest) (*BulkTestLogPoliciesResponse, error) + TogglePolicy(context.Context, *TogglePolicyRequest) (*TogglePolicyResponse, error) + mustEmbedUnimplementedPoliciesServiceServer() +} + +// UnimplementedPoliciesServiceServer must be embedded to have forward compatible implementations. +type UnimplementedPoliciesServiceServer struct { +} + +func (UnimplementedPoliciesServiceServer) GetPolicy(context.Context, *GetPolicyRequest) (*GetPolicyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPolicy not implemented") +} +func (UnimplementedPoliciesServiceServer) CreatePolicy(context.Context, *CreatePolicyRequest) (*CreatePolicyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreatePolicy not implemented") +} +func (UnimplementedPoliciesServiceServer) UpdatePolicy(context.Context, *UpdatePolicyRequest) (*UpdatePolicyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdatePolicy not implemented") +} +func (UnimplementedPoliciesServiceServer) GetCompanyPolicies(context.Context, *GetCompanyPoliciesRequest) (*GetCompanyPoliciesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCompanyPolicies not implemented") +} +func (UnimplementedPoliciesServiceServer) DeletePolicy(context.Context, *DeletePolicyRequest) (*DeletePolicyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeletePolicy not implemented") +} +func (UnimplementedPoliciesServiceServer) ReorderPolicies(context.Context, *ReorderPoliciesRequest) (*ReorderPoliciesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReorderPolicies not implemented") +} +func (UnimplementedPoliciesServiceServer) BulkTestLogPolicies(context.Context, *BulkTestLogPoliciesRequest) (*BulkTestLogPoliciesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BulkTestLogPolicies not implemented") +} +func (UnimplementedPoliciesServiceServer) TogglePolicy(context.Context, *TogglePolicyRequest) (*TogglePolicyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TogglePolicy not implemented") +} +func (UnimplementedPoliciesServiceServer) mustEmbedUnimplementedPoliciesServiceServer() {} + +// UnsafePoliciesServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PoliciesServiceServer will +// result in compilation errors. +type UnsafePoliciesServiceServer interface { + mustEmbedUnimplementedPoliciesServiceServer() +} + +func RegisterPoliciesServiceServer(s grpc.ServiceRegistrar, srv PoliciesServiceServer) { + s.RegisterService(&PoliciesService_ServiceDesc, srv) +} + +func _PoliciesService_GetPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PoliciesServiceServer).GetPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.coralogix.quota.v1.PoliciesService/GetPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PoliciesServiceServer).GetPolicy(ctx, req.(*GetPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PoliciesService_CreatePolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreatePolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PoliciesServiceServer).CreatePolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.coralogix.quota.v1.PoliciesService/CreatePolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PoliciesServiceServer).CreatePolicy(ctx, req.(*CreatePolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PoliciesService_UpdatePolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdatePolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PoliciesServiceServer).UpdatePolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.coralogix.quota.v1.PoliciesService/UpdatePolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PoliciesServiceServer).UpdatePolicy(ctx, req.(*UpdatePolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PoliciesService_GetCompanyPolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCompanyPoliciesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PoliciesServiceServer).GetCompanyPolicies(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.coralogix.quota.v1.PoliciesService/GetCompanyPolicies", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PoliciesServiceServer).GetCompanyPolicies(ctx, req.(*GetCompanyPoliciesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PoliciesService_DeletePolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeletePolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PoliciesServiceServer).DeletePolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.coralogix.quota.v1.PoliciesService/DeletePolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PoliciesServiceServer).DeletePolicy(ctx, req.(*DeletePolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PoliciesService_ReorderPolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReorderPoliciesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PoliciesServiceServer).ReorderPolicies(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.coralogix.quota.v1.PoliciesService/ReorderPolicies", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PoliciesServiceServer).ReorderPolicies(ctx, req.(*ReorderPoliciesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PoliciesService_BulkTestLogPolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BulkTestLogPoliciesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PoliciesServiceServer).BulkTestLogPolicies(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.coralogix.quota.v1.PoliciesService/BulkTestLogPolicies", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PoliciesServiceServer).BulkTestLogPolicies(ctx, req.(*BulkTestLogPoliciesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PoliciesService_TogglePolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TogglePolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PoliciesServiceServer).TogglePolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.coralogix.quota.v1.PoliciesService/TogglePolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PoliciesServiceServer).TogglePolicy(ctx, req.(*TogglePolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// PoliciesService_ServiceDesc is the grpc.ServiceDesc for PoliciesService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PoliciesService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "com.coralogix.quota.v1.PoliciesService", + HandlerType: (*PoliciesServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetPolicy", + Handler: _PoliciesService_GetPolicy_Handler, + }, + { + MethodName: "CreatePolicy", + Handler: _PoliciesService_CreatePolicy_Handler, + }, + { + MethodName: "UpdatePolicy", + Handler: _PoliciesService_UpdatePolicy_Handler, + }, + { + MethodName: "GetCompanyPolicies", + Handler: _PoliciesService_GetCompanyPolicies_Handler, + }, + { + MethodName: "DeletePolicy", + Handler: _PoliciesService_DeletePolicy_Handler, + }, + { + MethodName: "ReorderPolicies", + Handler: _PoliciesService_ReorderPolicies_Handler, + }, + { + MethodName: "BulkTestLogPolicies", + Handler: _PoliciesService_BulkTestLogPolicies_Handler, + }, + { + MethodName: "TogglePolicy", + Handler: _PoliciesService_TogglePolicy_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "com/coralogix/quota/v1/policies_service.proto", +} diff --git a/coralogix/clientset/grpc/tco-policies/policy.pb.go b/coralogix/clientset/grpc/tco-policies/policy.pb.go new file mode 100644 index 00000000..6f7644f9 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/policy.pb.go @@ -0,0 +1,393 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/policy.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 Policy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + CompanyId *wrapperspb.Int32Value `protobuf:"bytes,2,opt,name=company_id,json=companyId,proto3" json:"company_id,omitempty"` + Name *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Description *wrapperspb.StringValue `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + Priority Priority `protobuf:"varint,5,opt,name=priority,proto3,enum=com.coralogix.quota.v1.Priority" json:"priority,omitempty"` + Deleted *wrapperspb.BoolValue `protobuf:"bytes,6,opt,name=deleted,proto3" json:"deleted,omitempty"` + Enabled *wrapperspb.BoolValue `protobuf:"bytes,7,opt,name=enabled,proto3" json:"enabled,omitempty"` + Order *wrapperspb.Int32Value `protobuf:"bytes,8,opt,name=order,proto3" json:"order,omitempty"` + ApplicationRule *Rule `protobuf:"bytes,9,opt,name=application_rule,json=applicationRule,proto3,oneof" json:"application_rule,omitempty"` + SubsystemRule *Rule `protobuf:"bytes,10,opt,name=subsystem_rule,json=subsystemRule,proto3,oneof" json:"subsystem_rule,omitempty"` + // Types that are assignable to SourceTypeRules: + // *Policy_LogRules + // *Policy_SpanRules + SourceTypeRules isPolicy_SourceTypeRules `protobuf_oneof:"source_type_rules"` + CreatedAt *wrapperspb.StringValue `protobuf:"bytes,13,opt,name=created_at,json=createdAt,proto3,oneof" json:"created_at,omitempty"` + UpdatedAt *wrapperspb.StringValue `protobuf:"bytes,14,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"` + ArchiveRetention *ArchiveRetention `protobuf:"bytes,15,opt,name=archive_retention,json=archiveRetention,proto3,oneof" json:"archive_retention,omitempty"` +} + +func (x *Policy) Reset() { + *x = Policy{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_policy_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Policy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Policy) ProtoMessage() {} + +func (x *Policy) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_policy_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 Policy.ProtoReflect.Descriptor instead. +func (*Policy) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_policy_proto_rawDescGZIP(), []int{0} +} + +func (x *Policy) GetId() *wrapperspb.StringValue { + if x != nil { + return x.Id + } + return nil +} + +func (x *Policy) GetCompanyId() *wrapperspb.Int32Value { + if x != nil { + return x.CompanyId + } + return nil +} + +func (x *Policy) GetName() *wrapperspb.StringValue { + if x != nil { + return x.Name + } + return nil +} + +func (x *Policy) GetDescription() *wrapperspb.StringValue { + if x != nil { + return x.Description + } + return nil +} + +func (x *Policy) GetPriority() Priority { + if x != nil { + return x.Priority + } + return Priority_PRIORITY_TYPE_UNSPECIFIED +} + +func (x *Policy) GetDeleted() *wrapperspb.BoolValue { + if x != nil { + return x.Deleted + } + return nil +} + +func (x *Policy) GetEnabled() *wrapperspb.BoolValue { + if x != nil { + return x.Enabled + } + return nil +} + +func (x *Policy) GetOrder() *wrapperspb.Int32Value { + if x != nil { + return x.Order + } + return nil +} + +func (x *Policy) GetApplicationRule() *Rule { + if x != nil { + return x.ApplicationRule + } + return nil +} + +func (x *Policy) GetSubsystemRule() *Rule { + if x != nil { + return x.SubsystemRule + } + return nil +} + +func (m *Policy) GetSourceTypeRules() isPolicy_SourceTypeRules { + if m != nil { + return m.SourceTypeRules + } + return nil +} + +func (x *Policy) GetLogRules() *LogRules { + if x, ok := x.GetSourceTypeRules().(*Policy_LogRules); ok { + return x.LogRules + } + return nil +} + +func (x *Policy) GetSpanRules() *SpanRules { + if x, ok := x.GetSourceTypeRules().(*Policy_SpanRules); ok { + return x.SpanRules + } + return nil +} + +func (x *Policy) GetCreatedAt() *wrapperspb.StringValue { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Policy) GetUpdatedAt() *wrapperspb.StringValue { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *Policy) GetArchiveRetention() *ArchiveRetention { + if x != nil { + return x.ArchiveRetention + } + return nil +} + +type isPolicy_SourceTypeRules interface { + isPolicy_SourceTypeRules() +} + +type Policy_LogRules struct { + LogRules *LogRules `protobuf:"bytes,11,opt,name=log_rules,json=logRules,proto3,oneof"` +} + +type Policy_SpanRules struct { + SpanRules *SpanRules `protobuf:"bytes,12,opt,name=span_rules,json=spanRules,proto3,oneof"` +} + +func (*Policy_LogRules) isPolicy_SourceTypeRules() {} + +func (*Policy_SpanRules) isPolicy_SourceTypeRules() {} + +var File_com_coralogix_quota_v1_policy_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_policy_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, + 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 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, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, + 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, 0x72, 0x65, + 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, + 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x21, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, + 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x75, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, + 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, + 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaf, 0x08, 0x0a, 0x06, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 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, 0x3a, + 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x5f, 0x69, 0x64, 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, + 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x49, 0x64, 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, 0x3e, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 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, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x08, + 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, + 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, + 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x07, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x06, 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, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, + 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x07, 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, 0x07, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x31, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, + 0x08, 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, 0x4c, 0x0a, 0x10, 0x61, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6c, + 0x65, 0x48, 0x01, 0x52, 0x0f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x75, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x48, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x48, 0x02, 0x52, + 0x0d, 0x73, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x75, 0x6c, 0x65, 0x88, 0x01, + 0x01, 0x12, 0x3f, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, + 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, + 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x48, 0x00, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x52, 0x75, 0x6c, + 0x65, 0x73, 0x12, 0x42, 0x0a, 0x0a, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, + 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x70, 0x61, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x48, 0x00, 0x52, 0x09, 0x73, 0x70, 0x61, + 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0d, 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, 0x48, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x88, 0x01, 0x01, 0x12, 0x40, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0e, 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, 0x48, 0x04, 0x52, 0x09, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x88, 0x01, 0x01, 0x12, 0x5a, 0x0a, 0x11, 0x61, 0x72, + 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, + 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x48, + 0x05, 0x52, 0x10, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, + 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x42, 0x13, 0x0a, 0x11, 0x5f, + 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, + 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x73, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x72, + 0x75, 0x6c, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, + 0x74, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, 0x72, 0x65, + 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_policy_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_policy_proto_rawDescData = file_com_coralogix_quota_v1_policy_proto_rawDesc +) + +func file_com_coralogix_quota_v1_policy_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_policy_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_policy_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_policy_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_policy_proto_rawDescData +} + +var file_com_coralogix_quota_v1_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_policy_proto_goTypes = []interface{}{ + (*Policy)(nil), // 0: com.coralogix.quota.v1.Policy + (*wrapperspb.StringValue)(nil), // 1: google.protobuf.StringValue + (*wrapperspb.Int32Value)(nil), // 2: google.protobuf.Int32Value + (Priority)(0), // 3: com.coralogix.quota.v1.Priority + (*wrapperspb.BoolValue)(nil), // 4: google.protobuf.BoolValue + (*Rule)(nil), // 5: com.coralogix.quota.v1.Rule + (*LogRules)(nil), // 6: com.coralogix.quota.v1.LogRules + (*SpanRules)(nil), // 7: com.coralogix.quota.v1.SpanRules + (*ArchiveRetention)(nil), // 8: com.coralogix.quota.v1.ArchiveRetention +} +var file_com_coralogix_quota_v1_policy_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.Policy.id:type_name -> google.protobuf.StringValue + 2, // 1: com.coralogix.quota.v1.Policy.company_id:type_name -> google.protobuf.Int32Value + 1, // 2: com.coralogix.quota.v1.Policy.name:type_name -> google.protobuf.StringValue + 1, // 3: com.coralogix.quota.v1.Policy.description:type_name -> google.protobuf.StringValue + 3, // 4: com.coralogix.quota.v1.Policy.priority:type_name -> com.coralogix.quota.v1.Priority + 4, // 5: com.coralogix.quota.v1.Policy.deleted:type_name -> google.protobuf.BoolValue + 4, // 6: com.coralogix.quota.v1.Policy.enabled:type_name -> google.protobuf.BoolValue + 2, // 7: com.coralogix.quota.v1.Policy.order:type_name -> google.protobuf.Int32Value + 5, // 8: com.coralogix.quota.v1.Policy.application_rule:type_name -> com.coralogix.quota.v1.Rule + 5, // 9: com.coralogix.quota.v1.Policy.subsystem_rule:type_name -> com.coralogix.quota.v1.Rule + 6, // 10: com.coralogix.quota.v1.Policy.log_rules:type_name -> com.coralogix.quota.v1.LogRules + 7, // 11: com.coralogix.quota.v1.Policy.span_rules:type_name -> com.coralogix.quota.v1.SpanRules + 1, // 12: com.coralogix.quota.v1.Policy.created_at:type_name -> google.protobuf.StringValue + 1, // 13: com.coralogix.quota.v1.Policy.updated_at:type_name -> google.protobuf.StringValue + 8, // 14: com.coralogix.quota.v1.Policy.archive_retention:type_name -> com.coralogix.quota.v1.ArchiveRetention + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_policy_proto_init() } +func file_com_coralogix_quota_v1_policy_proto_init() { + if File_com_coralogix_quota_v1_policy_proto != nil { + return + } + file_com_coralogix_quota_v1_archive_retention_proto_init() + file_com_coralogix_quota_v1_enums_proto_init() + file_com_coralogix_quota_v1_rule_proto_init() + file_com_coralogix_quota_v1_log_rules_proto_init() + file_com_coralogix_quota_v1_span_rules_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_policy_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Policy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_com_coralogix_quota_v1_policy_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*Policy_LogRules)(nil), + (*Policy_SpanRules)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_com_coralogix_quota_v1_policy_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_policy_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_policy_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_policy_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_policy_proto = out.File + file_com_coralogix_quota_v1_policy_proto_rawDesc = nil + file_com_coralogix_quota_v1_policy_proto_goTypes = nil + file_com_coralogix_quota_v1_policy_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/policy_order.pb.go b/coralogix/clientset/grpc/tco-policies/policy_order.pb.go new file mode 100644 index 00000000..a7e48634 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/policy_order.pb.go @@ -0,0 +1,164 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/policy_order.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 PolicyOrder struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Order *wrapperspb.Int32Value `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` + Id *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *PolicyOrder) Reset() { + *x = PolicyOrder{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_policy_order_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PolicyOrder) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PolicyOrder) ProtoMessage() {} + +func (x *PolicyOrder) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_policy_order_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 PolicyOrder.ProtoReflect.Descriptor instead. +func (*PolicyOrder) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_policy_order_proto_rawDescGZIP(), []int{0} +} + +func (x *PolicyOrder) GetOrder() *wrapperspb.Int32Value { + if x != nil { + return x.Order + } + return nil +} + +func (x *PolicyOrder) GetId() *wrapperspb.StringValue { + if x != nil { + return x.Id + } + return nil +} + +var File_com_coralogix_quota_v1_policy_order_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_policy_order_proto_rawDesc = []byte{ + 0x0a, 0x29, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, + 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, 0x6e, 0x0a, 0x0b, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4f, 0x72, 0x64, + 0x65, 0x72, 0x12, 0x31, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 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, 0x2c, 0x0a, 0x02, 0x69, 0x64, 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, 0x52, + 0x02, 0x69, 0x64, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_com_coralogix_quota_v1_policy_order_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_policy_order_proto_rawDescData = file_com_coralogix_quota_v1_policy_order_proto_rawDesc +) + +func file_com_coralogix_quota_v1_policy_order_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_policy_order_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_policy_order_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_policy_order_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_policy_order_proto_rawDescData +} + +var file_com_coralogix_quota_v1_policy_order_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_policy_order_proto_goTypes = []interface{}{ + (*PolicyOrder)(nil), // 0: com.coralogix.quota.v1.PolicyOrder + (*wrapperspb.Int32Value)(nil), // 1: google.protobuf.Int32Value + (*wrapperspb.StringValue)(nil), // 2: google.protobuf.StringValue +} +var file_com_coralogix_quota_v1_policy_order_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.PolicyOrder.order:type_name -> google.protobuf.Int32Value + 2, // 1: com.coralogix.quota.v1.PolicyOrder.id:type_name -> google.protobuf.StringValue + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_policy_order_proto_init() } +func file_com_coralogix_quota_v1_policy_order_proto_init() { + if File_com_coralogix_quota_v1_policy_order_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_policy_order_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PolicyOrder); 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_quota_v1_policy_order_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_policy_order_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_policy_order_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_policy_order_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_policy_order_proto = out.File + file_com_coralogix_quota_v1_policy_order_proto_rawDesc = nil + file_com_coralogix_quota_v1_policy_order_proto_goTypes = nil + file_com_coralogix_quota_v1_policy_order_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/reorder_policies_request.pb.go b/coralogix/clientset/grpc/tco-policies/reorder_policies_request.pb.go new file mode 100644 index 00000000..4f6301d6 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/reorder_policies_request.pb.go @@ -0,0 +1,171 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/reorder_policies_request.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 ReorderPoliciesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Orders []*PolicyOrder `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders,omitempty"` + SourceType SourceType `protobuf:"varint,2,opt,name=source_type,json=sourceType,proto3,enum=com.coralogix.quota.v1.SourceType" json:"source_type,omitempty"` +} + +func (x *ReorderPoliciesRequest) Reset() { + *x = ReorderPoliciesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_reorder_policies_request_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReorderPoliciesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReorderPoliciesRequest) ProtoMessage() {} + +func (x *ReorderPoliciesRequest) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_reorder_policies_request_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 ReorderPoliciesRequest.ProtoReflect.Descriptor instead. +func (*ReorderPoliciesRequest) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_reorder_policies_request_proto_rawDescGZIP(), []int{0} +} + +func (x *ReorderPoliciesRequest) GetOrders() []*PolicyOrder { + if x != nil { + return x.Orders + } + return nil +} + +func (x *ReorderPoliciesRequest) GetSourceType() SourceType { + if x != nil { + return x.SourceType + } + return SourceType_SOURCE_TYPE_UNSPECIFIED +} + +var File_com_coralogix_quota_v1_reorder_policies_request_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_reorder_policies_request_proto_rawDesc = []byte{ + 0x0a, 0x35, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, + 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x1a, + 0x22, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, + 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x29, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, + 0x01, 0x0a, 0x16, 0x52, 0x65, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x06, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x06, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x43, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x63, 0x6f, + 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, + 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x04, 0x5a, 0x02, 0x2e, + 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_reorder_policies_request_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_reorder_policies_request_proto_rawDescData = file_com_coralogix_quota_v1_reorder_policies_request_proto_rawDesc +) + +func file_com_coralogix_quota_v1_reorder_policies_request_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_reorder_policies_request_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_reorder_policies_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_reorder_policies_request_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_reorder_policies_request_proto_rawDescData +} + +var file_com_coralogix_quota_v1_reorder_policies_request_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_reorder_policies_request_proto_goTypes = []interface{}{ + (*ReorderPoliciesRequest)(nil), // 0: com.coralogix.quota.v1.ReorderPoliciesRequest + (*PolicyOrder)(nil), // 1: com.coralogix.quota.v1.PolicyOrder + (SourceType)(0), // 2: com.coralogix.quota.v1.SourceType +} +var file_com_coralogix_quota_v1_reorder_policies_request_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.ReorderPoliciesRequest.orders:type_name -> com.coralogix.quota.v1.PolicyOrder + 2, // 1: com.coralogix.quota.v1.ReorderPoliciesRequest.source_type:type_name -> com.coralogix.quota.v1.SourceType + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_reorder_policies_request_proto_init() } +func file_com_coralogix_quota_v1_reorder_policies_request_proto_init() { + if File_com_coralogix_quota_v1_reorder_policies_request_proto != nil { + return + } + file_com_coralogix_quota_v1_enums_proto_init() + file_com_coralogix_quota_v1_policy_order_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_reorder_policies_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReorderPoliciesRequest); 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_quota_v1_reorder_policies_request_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_reorder_policies_request_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_reorder_policies_request_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_reorder_policies_request_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_reorder_policies_request_proto = out.File + file_com_coralogix_quota_v1_reorder_policies_request_proto_rawDesc = nil + file_com_coralogix_quota_v1_reorder_policies_request_proto_goTypes = nil + file_com_coralogix_quota_v1_reorder_policies_request_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/reorder_policies_response.pb.go b/coralogix/clientset/grpc/tco-policies/reorder_policies_response.pb.go new file mode 100644 index 00000000..1a1a3647 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/reorder_policies_response.pb.go @@ -0,0 +1,154 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/reorder_policies_response.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 ReorderPoliciesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Orders []*PolicyOrder `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders,omitempty"` +} + +func (x *ReorderPoliciesResponse) Reset() { + *x = ReorderPoliciesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_reorder_policies_response_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReorderPoliciesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReorderPoliciesResponse) ProtoMessage() {} + +func (x *ReorderPoliciesResponse) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_reorder_policies_response_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 ReorderPoliciesResponse.ProtoReflect.Descriptor instead. +func (*ReorderPoliciesResponse) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_reorder_policies_response_proto_rawDescGZIP(), []int{0} +} + +func (x *ReorderPoliciesResponse) GetOrders() []*PolicyOrder { + if x != nil { + return x.Orders + } + return nil +} + +var File_com_coralogix_quota_v1_reorder_policies_response_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_reorder_policies_response_proto_rawDesc = []byte{ + 0x0a, 0x36, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, + 0x1a, 0x29, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x56, 0x0a, 0x17, 0x52, + 0x65, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, + 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x73, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_com_coralogix_quota_v1_reorder_policies_response_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_reorder_policies_response_proto_rawDescData = file_com_coralogix_quota_v1_reorder_policies_response_proto_rawDesc +) + +func file_com_coralogix_quota_v1_reorder_policies_response_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_reorder_policies_response_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_reorder_policies_response_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_reorder_policies_response_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_reorder_policies_response_proto_rawDescData +} + +var file_com_coralogix_quota_v1_reorder_policies_response_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_reorder_policies_response_proto_goTypes = []interface{}{ + (*ReorderPoliciesResponse)(nil), // 0: com.coralogix.quota.v1.ReorderPoliciesResponse + (*PolicyOrder)(nil), // 1: com.coralogix.quota.v1.PolicyOrder +} +var file_com_coralogix_quota_v1_reorder_policies_response_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.ReorderPoliciesResponse.orders:type_name -> com.coralogix.quota.v1.PolicyOrder + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_reorder_policies_response_proto_init() } +func file_com_coralogix_quota_v1_reorder_policies_response_proto_init() { + if File_com_coralogix_quota_v1_reorder_policies_response_proto != nil { + return + } + file_com_coralogix_quota_v1_policy_order_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_reorder_policies_response_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReorderPoliciesResponse); 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_quota_v1_reorder_policies_response_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_reorder_policies_response_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_reorder_policies_response_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_reorder_policies_response_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_reorder_policies_response_proto = out.File + file_com_coralogix_quota_v1_reorder_policies_response_proto_rawDesc = nil + file_com_coralogix_quota_v1_reorder_policies_response_proto_goTypes = nil + file_com_coralogix_quota_v1_reorder_policies_response_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/rule.pb.go b/coralogix/clientset/grpc/tco-policies/rule.pb.go new file mode 100644 index 00000000..ac818138 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/rule.pb.go @@ -0,0 +1,167 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/rule.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 Rule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RuleTypeId RuleTypeId `protobuf:"varint,1,opt,name=rule_type_id,json=ruleTypeId,proto3,enum=com.coralogix.quota.v1.RuleTypeId" json:"rule_type_id,omitempty"` + Name *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *Rule) Reset() { + *x = Rule{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_rule_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Rule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Rule) ProtoMessage() {} + +func (x *Rule) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_rule_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 Rule.ProtoReflect.Descriptor instead. +func (*Rule) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_rule_proto_rawDescGZIP(), []int{0} +} + +func (x *Rule) GetRuleTypeId() RuleTypeId { + if x != nil { + return x.RuleTypeId + } + return RuleTypeId_RULE_TYPE_ID_UNSPECIFIED +} + +func (x *Rule) GetName() *wrapperspb.StringValue { + if x != nil { + return x.Name + } + return nil +} + +var File_com_coralogix_quota_v1_rule_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_rule_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 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, 0x22, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, + 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x7e, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x44, 0x0a, 0x0c, 0x72, 0x75, 0x6c, 0x65, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, + 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x49, + 0x64, 0x52, 0x0a, 0x72, 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x30, 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, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, + 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_rule_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_rule_proto_rawDescData = file_com_coralogix_quota_v1_rule_proto_rawDesc +) + +func file_com_coralogix_quota_v1_rule_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_rule_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_rule_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_rule_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_rule_proto_rawDescData +} + +var file_com_coralogix_quota_v1_rule_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_rule_proto_goTypes = []interface{}{ + (*Rule)(nil), // 0: com.coralogix.quota.v1.Rule + (RuleTypeId)(0), // 1: com.coralogix.quota.v1.RuleTypeId + (*wrapperspb.StringValue)(nil), // 2: google.protobuf.StringValue +} +var file_com_coralogix_quota_v1_rule_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.Rule.rule_type_id:type_name -> com.coralogix.quota.v1.RuleTypeId + 2, // 1: com.coralogix.quota.v1.Rule.name:type_name -> google.protobuf.StringValue + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_rule_proto_init() } +func file_com_coralogix_quota_v1_rule_proto_init() { + if File_com_coralogix_quota_v1_rule_proto != nil { + return + } + file_com_coralogix_quota_v1_enums_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_rule_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Rule); 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_quota_v1_rule_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_rule_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_rule_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_rule_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_rule_proto = out.File + file_com_coralogix_quota_v1_rule_proto_rawDesc = nil + file_com_coralogix_quota_v1_rule_proto_goTypes = nil + file_com_coralogix_quota_v1_rule_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/span_rules.pb.go b/coralogix/clientset/grpc/tco-policies/span_rules.pb.go new file mode 100644 index 00000000..00bb0c56 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/span_rules.pb.go @@ -0,0 +1,185 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/span_rules.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 SpanRules struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServiceRule *Rule `protobuf:"bytes,1,opt,name=service_rule,json=serviceRule,proto3,oneof" json:"service_rule,omitempty"` + ActionRule *Rule `protobuf:"bytes,2,opt,name=action_rule,json=actionRule,proto3,oneof" json:"action_rule,omitempty"` + TagRules []*TagRule `protobuf:"bytes,3,rep,name=tag_rules,json=tagRules,proto3" json:"tag_rules,omitempty"` +} + +func (x *SpanRules) Reset() { + *x = SpanRules{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_span_rules_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SpanRules) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SpanRules) ProtoMessage() {} + +func (x *SpanRules) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_span_rules_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 SpanRules.ProtoReflect.Descriptor instead. +func (*SpanRules) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_span_rules_proto_rawDescGZIP(), []int{0} +} + +func (x *SpanRules) GetServiceRule() *Rule { + if x != nil { + return x.ServiceRule + } + return nil +} + +func (x *SpanRules) GetActionRule() *Rule { + if x != nil { + return x.ActionRule + } + return nil +} + +func (x *SpanRules) GetTagRules() []*TagRule { + if x != nil { + return x.TagRules + } + return nil +} + +var File_com_coralogix_quota_v1_span_rules_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_span_rules_proto_rawDesc = []byte{ + 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x72, 0x75, + 0x6c, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, + 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, + 0x31, 0x1a, 0x21, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, + 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x75, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x61, 0x67, + 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf4, 0x01, 0x0a, 0x09, + 0x53, 0x70, 0x61, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x0c, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x48, 0x00, 0x52, + 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x75, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, + 0x42, 0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, + 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, + 0x6c, 0x65, 0x48, 0x01, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x3c, 0x0a, 0x09, 0x74, 0x61, 0x67, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, + 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, + 0x54, 0x61, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x08, 0x74, 0x61, 0x67, 0x52, 0x75, 0x6c, 0x65, + 0x73, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x72, 0x75, + 0x6c, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, + 0x6c, 0x65, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_span_rules_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_span_rules_proto_rawDescData = file_com_coralogix_quota_v1_span_rules_proto_rawDesc +) + +func file_com_coralogix_quota_v1_span_rules_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_span_rules_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_span_rules_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_span_rules_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_span_rules_proto_rawDescData +} + +var file_com_coralogix_quota_v1_span_rules_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_span_rules_proto_goTypes = []interface{}{ + (*SpanRules)(nil), // 0: com.coralogix.quota.v1.SpanRules + (*Rule)(nil), // 1: com.coralogix.quota.v1.Rule + (*TagRule)(nil), // 2: com.coralogix.quota.v1.TagRule +} +var file_com_coralogix_quota_v1_span_rules_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.SpanRules.service_rule:type_name -> com.coralogix.quota.v1.Rule + 1, // 1: com.coralogix.quota.v1.SpanRules.action_rule:type_name -> com.coralogix.quota.v1.Rule + 2, // 2: com.coralogix.quota.v1.SpanRules.tag_rules:type_name -> com.coralogix.quota.v1.TagRule + 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_quota_v1_span_rules_proto_init() } +func file_com_coralogix_quota_v1_span_rules_proto_init() { + if File_com_coralogix_quota_v1_span_rules_proto != nil { + return + } + file_com_coralogix_quota_v1_rule_proto_init() + file_com_coralogix_quota_v1_tag_rule_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_span_rules_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SpanRules); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_com_coralogix_quota_v1_span_rules_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_com_coralogix_quota_v1_span_rules_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_span_rules_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_span_rules_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_span_rules_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_span_rules_proto = out.File + file_com_coralogix_quota_v1_span_rules_proto_rawDesc = nil + file_com_coralogix_quota_v1_span_rules_proto_goTypes = nil + file_com_coralogix_quota_v1_span_rules_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/tag_rule.pb.go b/coralogix/clientset/grpc/tco-policies/tag_rule.pb.go new file mode 100644 index 00000000..511f9d86 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/tag_rule.pb.go @@ -0,0 +1,181 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/tag_rule.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 TagRule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RuleTypeId RuleTypeId `protobuf:"varint,1,opt,name=rule_type_id,json=ruleTypeId,proto3,enum=com.coralogix.quota.v1.RuleTypeId" json:"rule_type_id,omitempty"` + TagName *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=tag_name,json=tagName,proto3" json:"tag_name,omitempty"` + TagValue *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=tag_value,json=tagValue,proto3" json:"tag_value,omitempty"` +} + +func (x *TagRule) Reset() { + *x = TagRule{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_tag_rule_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TagRule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TagRule) ProtoMessage() {} + +func (x *TagRule) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_tag_rule_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 TagRule.ProtoReflect.Descriptor instead. +func (*TagRule) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_tag_rule_proto_rawDescGZIP(), []int{0} +} + +func (x *TagRule) GetRuleTypeId() RuleTypeId { + if x != nil { + return x.RuleTypeId + } + return RuleTypeId_RULE_TYPE_ID_UNSPECIFIED +} + +func (x *TagRule) GetTagName() *wrapperspb.StringValue { + if x != nil { + return x.TagName + } + return nil +} + +func (x *TagRule) GetTagValue() *wrapperspb.StringValue { + if x != nil { + return x.TagValue + } + return nil +} + +var File_com_coralogix_quota_v1_tag_rule_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_tag_rule_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x61, 0x67, 0x5f, 0x72, 0x75, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, + 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 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, + 0x22, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, + 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xc3, 0x01, 0x0a, 0x07, 0x54, 0x61, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x12, + 0x44, 0x0a, 0x0c, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, + 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x52, + 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x52, 0x0a, 0x72, 0x75, 0x6c, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x08, 0x74, 0x61, 0x67, 0x5f, 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, 0x52, 0x07, 0x74, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39, + 0x0a, 0x09, 0x74, 0x61, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 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, + 0x08, 0x74, 0x61, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_tag_rule_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_tag_rule_proto_rawDescData = file_com_coralogix_quota_v1_tag_rule_proto_rawDesc +) + +func file_com_coralogix_quota_v1_tag_rule_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_tag_rule_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_tag_rule_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_tag_rule_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_tag_rule_proto_rawDescData +} + +var file_com_coralogix_quota_v1_tag_rule_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_tag_rule_proto_goTypes = []interface{}{ + (*TagRule)(nil), // 0: com.coralogix.quota.v1.TagRule + (RuleTypeId)(0), // 1: com.coralogix.quota.v1.RuleTypeId + (*wrapperspb.StringValue)(nil), // 2: google.protobuf.StringValue +} +var file_com_coralogix_quota_v1_tag_rule_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.TagRule.rule_type_id:type_name -> com.coralogix.quota.v1.RuleTypeId + 2, // 1: com.coralogix.quota.v1.TagRule.tag_name:type_name -> google.protobuf.StringValue + 2, // 2: com.coralogix.quota.v1.TagRule.tag_value:type_name -> google.protobuf.StringValue + 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_quota_v1_tag_rule_proto_init() } +func file_com_coralogix_quota_v1_tag_rule_proto_init() { + if File_com_coralogix_quota_v1_tag_rule_proto != nil { + return + } + file_com_coralogix_quota_v1_enums_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_tag_rule_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TagRule); 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_quota_v1_tag_rule_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_tag_rule_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_tag_rule_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_tag_rule_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_tag_rule_proto = out.File + file_com_coralogix_quota_v1_tag_rule_proto_rawDesc = nil + file_com_coralogix_quota_v1_tag_rule_proto_goTypes = nil + file_com_coralogix_quota_v1_tag_rule_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/test_policies_result.pb.go b/coralogix/clientset/grpc/tco-policies/test_policies_result.pb.go new file mode 100644 index 00000000..e47091c6 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/test_policies_result.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/quota/v1/test_policies_result.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 TestPoliciesResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MetaFieldsValues *LogMetaFieldsValues `protobuf:"bytes,1,opt,name=meta_fields_values,json=metaFieldsValues,proto3" json:"meta_fields_values,omitempty"` + Matched *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=matched,proto3" json:"matched,omitempty"` + Policy *Policy `protobuf:"bytes,3,opt,name=policy,proto3" json:"policy,omitempty"` +} + +func (x *TestPoliciesResult) Reset() { + *x = TestPoliciesResult{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_test_policies_result_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TestPoliciesResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TestPoliciesResult) ProtoMessage() {} + +func (x *TestPoliciesResult) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_test_policies_result_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 TestPoliciesResult.ProtoReflect.Descriptor instead. +func (*TestPoliciesResult) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_test_policies_result_proto_rawDescGZIP(), []int{0} +} + +func (x *TestPoliciesResult) GetMetaFieldsValues() *LogMetaFieldsValues { + if x != nil { + return x.MetaFieldsValues + } + return nil +} + +func (x *TestPoliciesResult) GetMatched() *wrapperspb.BoolValue { + if x != nil { + return x.Matched + } + return nil +} + +func (x *TestPoliciesResult) GetPolicy() *Policy { + if x != nil { + return x.Policy + } + return nil +} + +var File_com_coralogix_quota_v1_test_policies_result_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_test_policies_result_proto_rawDesc = []byte{ + 0x0a, 0x31, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 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, 0x23, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x32, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x5f, 0x6d, 0x65, 0x74, + 0x61, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdd, 0x01, 0x0a, 0x12, 0x54, 0x65, 0x73, 0x74, 0x50, 0x6f, 0x6c, + 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x59, 0x0a, 0x12, 0x6d, + 0x65, 0x74, 0x61, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x6f, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x52, 0x10, 0x6d, 0x65, 0x74, 0x61, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x64, 0x18, 0x02, 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, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x06, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, + 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x06, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_test_policies_result_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_test_policies_result_proto_rawDescData = file_com_coralogix_quota_v1_test_policies_result_proto_rawDesc +) + +func file_com_coralogix_quota_v1_test_policies_result_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_test_policies_result_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_test_policies_result_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_test_policies_result_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_test_policies_result_proto_rawDescData +} + +var file_com_coralogix_quota_v1_test_policies_result_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_test_policies_result_proto_goTypes = []interface{}{ + (*TestPoliciesResult)(nil), // 0: com.coralogix.quota.v1.TestPoliciesResult + (*LogMetaFieldsValues)(nil), // 1: com.coralogix.quota.v1.LogMetaFieldsValues + (*wrapperspb.BoolValue)(nil), // 2: google.protobuf.BoolValue + (*Policy)(nil), // 3: com.coralogix.quota.v1.Policy +} +var file_com_coralogix_quota_v1_test_policies_result_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.TestPoliciesResult.meta_fields_values:type_name -> com.coralogix.quota.v1.LogMetaFieldsValues + 2, // 1: com.coralogix.quota.v1.TestPoliciesResult.matched:type_name -> google.protobuf.BoolValue + 3, // 2: com.coralogix.quota.v1.TestPoliciesResult.policy:type_name -> com.coralogix.quota.v1.Policy + 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_quota_v1_test_policies_result_proto_init() } +func file_com_coralogix_quota_v1_test_policies_result_proto_init() { + if File_com_coralogix_quota_v1_test_policies_result_proto != nil { + return + } + file_com_coralogix_quota_v1_policy_proto_init() + file_com_coralogix_quota_v1_log_meta_field_values_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_test_policies_result_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TestPoliciesResult); 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_quota_v1_test_policies_result_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_test_policies_result_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_test_policies_result_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_test_policies_result_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_test_policies_result_proto = out.File + file_com_coralogix_quota_v1_test_policies_result_proto_rawDesc = nil + file_com_coralogix_quota_v1_test_policies_result_proto_goTypes = nil + file_com_coralogix_quota_v1_test_policies_result_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/toggle_policy_request.pb.go b/coralogix/clientset/grpc/tco-policies/toggle_policy_request.pb.go new file mode 100644 index 00000000..88d114fd --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/toggle_policy_request.pb.go @@ -0,0 +1,165 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/toggle_policy_request.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 TogglePolicyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Enabled *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=enabled,proto3" json:"enabled,omitempty"` +} + +func (x *TogglePolicyRequest) Reset() { + *x = TogglePolicyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_toggle_policy_request_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TogglePolicyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TogglePolicyRequest) ProtoMessage() {} + +func (x *TogglePolicyRequest) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_toggle_policy_request_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 TogglePolicyRequest.ProtoReflect.Descriptor instead. +func (*TogglePolicyRequest) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_toggle_policy_request_proto_rawDescGZIP(), []int{0} +} + +func (x *TogglePolicyRequest) GetId() *wrapperspb.StringValue { + if x != nil { + return x.Id + } + return nil +} + +func (x *TogglePolicyRequest) GetEnabled() *wrapperspb.BoolValue { + if x != nil { + return x.Enabled + } + return nil +} + +var File_com_coralogix_quota_v1_toggle_policy_request_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_toggle_policy_request_proto_rawDesc = []byte{ + 0x0a, 0x32, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x5f, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 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, 0x79, 0x0a, 0x13, + 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 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, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 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, 0x07, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_toggle_policy_request_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_toggle_policy_request_proto_rawDescData = file_com_coralogix_quota_v1_toggle_policy_request_proto_rawDesc +) + +func file_com_coralogix_quota_v1_toggle_policy_request_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_toggle_policy_request_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_toggle_policy_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_toggle_policy_request_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_toggle_policy_request_proto_rawDescData +} + +var file_com_coralogix_quota_v1_toggle_policy_request_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_toggle_policy_request_proto_goTypes = []interface{}{ + (*TogglePolicyRequest)(nil), // 0: com.coralogix.quota.v1.TogglePolicyRequest + (*wrapperspb.StringValue)(nil), // 1: google.protobuf.StringValue + (*wrapperspb.BoolValue)(nil), // 2: google.protobuf.BoolValue +} +var file_com_coralogix_quota_v1_toggle_policy_request_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.TogglePolicyRequest.id:type_name -> google.protobuf.StringValue + 2, // 1: com.coralogix.quota.v1.TogglePolicyRequest.enabled:type_name -> google.protobuf.BoolValue + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_toggle_policy_request_proto_init() } +func file_com_coralogix_quota_v1_toggle_policy_request_proto_init() { + if File_com_coralogix_quota_v1_toggle_policy_request_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_toggle_policy_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TogglePolicyRequest); 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_quota_v1_toggle_policy_request_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_toggle_policy_request_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_toggle_policy_request_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_toggle_policy_request_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_toggle_policy_request_proto = out.File + file_com_coralogix_quota_v1_toggle_policy_request_proto_rawDesc = nil + file_com_coralogix_quota_v1_toggle_policy_request_proto_goTypes = nil + file_com_coralogix_quota_v1_toggle_policy_request_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/toggle_policy_response.pb.go b/coralogix/clientset/grpc/tco-policies/toggle_policy_response.pb.go new file mode 100644 index 00000000..fcef7239 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/toggle_policy_response.pb.go @@ -0,0 +1,165 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/toggle_policy_response.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 TogglePolicyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Enabled *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=enabled,proto3" json:"enabled,omitempty"` +} + +func (x *TogglePolicyResponse) Reset() { + *x = TogglePolicyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_toggle_policy_response_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TogglePolicyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TogglePolicyResponse) ProtoMessage() {} + +func (x *TogglePolicyResponse) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_toggle_policy_response_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 TogglePolicyResponse.ProtoReflect.Descriptor instead. +func (*TogglePolicyResponse) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_toggle_policy_response_proto_rawDescGZIP(), []int{0} +} + +func (x *TogglePolicyResponse) GetId() *wrapperspb.StringValue { + if x != nil { + return x.Id + } + return nil +} + +func (x *TogglePolicyResponse) GetEnabled() *wrapperspb.BoolValue { + if x != nil { + return x.Enabled + } + return nil +} + +var File_com_coralogix_quota_v1_toggle_policy_response_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_toggle_policy_response_proto_rawDesc = []byte{ + 0x0a, 0x33, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x5f, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, + 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 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, 0x7a, 0x0a, + 0x14, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, + 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, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_toggle_policy_response_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_toggle_policy_response_proto_rawDescData = file_com_coralogix_quota_v1_toggle_policy_response_proto_rawDesc +) + +func file_com_coralogix_quota_v1_toggle_policy_response_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_toggle_policy_response_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_toggle_policy_response_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_toggle_policy_response_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_toggle_policy_response_proto_rawDescData +} + +var file_com_coralogix_quota_v1_toggle_policy_response_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_toggle_policy_response_proto_goTypes = []interface{}{ + (*TogglePolicyResponse)(nil), // 0: com.coralogix.quota.v1.TogglePolicyResponse + (*wrapperspb.StringValue)(nil), // 1: google.protobuf.StringValue + (*wrapperspb.BoolValue)(nil), // 2: google.protobuf.BoolValue +} +var file_com_coralogix_quota_v1_toggle_policy_response_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.TogglePolicyResponse.id:type_name -> google.protobuf.StringValue + 2, // 1: com.coralogix.quota.v1.TogglePolicyResponse.enabled:type_name -> google.protobuf.BoolValue + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_toggle_policy_response_proto_init() } +func file_com_coralogix_quota_v1_toggle_policy_response_proto_init() { + if File_com_coralogix_quota_v1_toggle_policy_response_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_toggle_policy_response_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TogglePolicyResponse); 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_quota_v1_toggle_policy_response_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_toggle_policy_response_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_toggle_policy_response_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_toggle_policy_response_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_toggle_policy_response_proto = out.File + file_com_coralogix_quota_v1_toggle_policy_response_proto_rawDesc = nil + file_com_coralogix_quota_v1_toggle_policy_response_proto_goTypes = nil + file_com_coralogix_quota_v1_toggle_policy_response_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/update_policy_request.pb.go b/coralogix/clientset/grpc/tco-policies/update_policy_request.pb.go new file mode 100644 index 00000000..fea59cd3 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/update_policy_request.pb.go @@ -0,0 +1,315 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/update_policy_request.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 UpdatePolicyRequest 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"` + Description *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Priority Priority `protobuf:"varint,4,opt,name=priority,proto3,enum=com.coralogix.quota.v1.Priority" json:"priority,omitempty"` + ApplicationRule *Rule `protobuf:"bytes,5,opt,name=application_rule,json=applicationRule,proto3,oneof" json:"application_rule,omitempty"` + SubsystemRule *Rule `protobuf:"bytes,6,opt,name=subsystem_rule,json=subsystemRule,proto3,oneof" json:"subsystem_rule,omitempty"` + ArchiveRetention *ArchiveRetention `protobuf:"bytes,7,opt,name=archive_retention,json=archiveRetention,proto3,oneof" json:"archive_retention,omitempty"` + // Types that are assignable to SourceTypeRules: + // *UpdatePolicyRequest_LogRules + // *UpdatePolicyRequest_SpanRules + SourceTypeRules isUpdatePolicyRequest_SourceTypeRules `protobuf_oneof:"source_type_rules"` +} + +func (x *UpdatePolicyRequest) Reset() { + *x = UpdatePolicyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_update_policy_request_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdatePolicyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePolicyRequest) ProtoMessage() {} + +func (x *UpdatePolicyRequest) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_update_policy_request_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 UpdatePolicyRequest.ProtoReflect.Descriptor instead. +func (*UpdatePolicyRequest) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_update_policy_request_proto_rawDescGZIP(), []int{0} +} + +func (x *UpdatePolicyRequest) GetId() *wrapperspb.StringValue { + if x != nil { + return x.Id + } + return nil +} + +func (x *UpdatePolicyRequest) GetName() *wrapperspb.StringValue { + if x != nil { + return x.Name + } + return nil +} + +func (x *UpdatePolicyRequest) GetDescription() *wrapperspb.StringValue { + if x != nil { + return x.Description + } + return nil +} + +func (x *UpdatePolicyRequest) GetPriority() Priority { + if x != nil { + return x.Priority + } + return Priority_PRIORITY_TYPE_UNSPECIFIED +} + +func (x *UpdatePolicyRequest) GetApplicationRule() *Rule { + if x != nil { + return x.ApplicationRule + } + return nil +} + +func (x *UpdatePolicyRequest) GetSubsystemRule() *Rule { + if x != nil { + return x.SubsystemRule + } + return nil +} + +func (x *UpdatePolicyRequest) GetArchiveRetention() *ArchiveRetention { + if x != nil { + return x.ArchiveRetention + } + return nil +} + +func (m *UpdatePolicyRequest) GetSourceTypeRules() isUpdatePolicyRequest_SourceTypeRules { + if m != nil { + return m.SourceTypeRules + } + return nil +} + +func (x *UpdatePolicyRequest) GetLogRules() *LogRules { + if x, ok := x.GetSourceTypeRules().(*UpdatePolicyRequest_LogRules); ok { + return x.LogRules + } + return nil +} + +func (x *UpdatePolicyRequest) GetSpanRules() *SpanRules { + if x, ok := x.GetSourceTypeRules().(*UpdatePolicyRequest_SpanRules); ok { + return x.SpanRules + } + return nil +} + +type isUpdatePolicyRequest_SourceTypeRules interface { + isUpdatePolicyRequest_SourceTypeRules() +} + +type UpdatePolicyRequest_LogRules struct { + LogRules *LogRules `protobuf:"bytes,8,opt,name=log_rules,json=logRules,proto3,oneof"` +} + +type UpdatePolicyRequest_SpanRules struct { + SpanRules *SpanRules `protobuf:"bytes,9,opt,name=span_rules,json=spanRules,proto3,oneof"` +} + +func (*UpdatePolicyRequest_LogRules) isUpdatePolicyRequest_SourceTypeRules() {} + +func (*UpdatePolicyRequest_SpanRules) isUpdatePolicyRequest_SourceTypeRules() {} + +var File_com_coralogix_quota_v1_update_policy_request_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_update_policy_request_proto_rawDesc = []byte{ + 0x0a, 0x32, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 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, 0x22, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, + 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x21, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x72, 0x63, 0x68, + 0x69, 0x76, 0x65, 0x5f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, + 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x5f, + 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, 0x74, 0x61, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x05, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x30, 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, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 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, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x08, + 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, + 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, + 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x4c, 0x0a, 0x10, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, + 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, + 0x6c, 0x65, 0x48, 0x01, 0x52, 0x0f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x48, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x73, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, + 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x48, 0x02, + 0x52, 0x0d, 0x73, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x75, 0x6c, 0x65, 0x88, + 0x01, 0x01, 0x12, 0x5a, 0x0a, 0x11, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, 0x72, 0x65, + 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, + 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x52, 0x65, + 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x03, 0x52, 0x10, 0x61, 0x72, 0x63, 0x68, 0x69, + 0x76, 0x65, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x3f, + 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, + 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x75, + 0x6c, 0x65, 0x73, 0x48, 0x00, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, + 0x42, 0x0a, 0x0a, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, + 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, + 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x48, 0x00, 0x52, 0x09, 0x73, 0x70, 0x61, 0x6e, 0x52, 0x75, + 0x6c, 0x65, 0x73, 0x42, 0x13, 0x0a, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x61, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x42, 0x11, 0x0a, + 0x0f, 0x5f, 0x73, 0x75, 0x62, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x72, 0x75, 0x6c, 0x65, + 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, 0x72, 0x65, 0x74, + 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_update_policy_request_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_update_policy_request_proto_rawDescData = file_com_coralogix_quota_v1_update_policy_request_proto_rawDesc +) + +func file_com_coralogix_quota_v1_update_policy_request_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_update_policy_request_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_update_policy_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_update_policy_request_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_update_policy_request_proto_rawDescData +} + +var file_com_coralogix_quota_v1_update_policy_request_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_update_policy_request_proto_goTypes = []interface{}{ + (*UpdatePolicyRequest)(nil), // 0: com.coralogix.quota.v1.UpdatePolicyRequest + (*wrapperspb.StringValue)(nil), // 1: google.protobuf.StringValue + (Priority)(0), // 2: com.coralogix.quota.v1.Priority + (*Rule)(nil), // 3: com.coralogix.quota.v1.Rule + (*ArchiveRetention)(nil), // 4: com.coralogix.quota.v1.ArchiveRetention + (*LogRules)(nil), // 5: com.coralogix.quota.v1.LogRules + (*SpanRules)(nil), // 6: com.coralogix.quota.v1.SpanRules +} +var file_com_coralogix_quota_v1_update_policy_request_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.UpdatePolicyRequest.id:type_name -> google.protobuf.StringValue + 1, // 1: com.coralogix.quota.v1.UpdatePolicyRequest.name:type_name -> google.protobuf.StringValue + 1, // 2: com.coralogix.quota.v1.UpdatePolicyRequest.description:type_name -> google.protobuf.StringValue + 2, // 3: com.coralogix.quota.v1.UpdatePolicyRequest.priority:type_name -> com.coralogix.quota.v1.Priority + 3, // 4: com.coralogix.quota.v1.UpdatePolicyRequest.application_rule:type_name -> com.coralogix.quota.v1.Rule + 3, // 5: com.coralogix.quota.v1.UpdatePolicyRequest.subsystem_rule:type_name -> com.coralogix.quota.v1.Rule + 4, // 6: com.coralogix.quota.v1.UpdatePolicyRequest.archive_retention:type_name -> com.coralogix.quota.v1.ArchiveRetention + 5, // 7: com.coralogix.quota.v1.UpdatePolicyRequest.log_rules:type_name -> com.coralogix.quota.v1.LogRules + 6, // 8: com.coralogix.quota.v1.UpdatePolicyRequest.span_rules:type_name -> com.coralogix.quota.v1.SpanRules + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_update_policy_request_proto_init() } +func file_com_coralogix_quota_v1_update_policy_request_proto_init() { + if File_com_coralogix_quota_v1_update_policy_request_proto != nil { + return + } + file_com_coralogix_quota_v1_enums_proto_init() + file_com_coralogix_quota_v1_rule_proto_init() + file_com_coralogix_quota_v1_archive_retention_proto_init() + file_com_coralogix_quota_v1_log_rules_proto_init() + file_com_coralogix_quota_v1_span_rules_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_update_policy_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdatePolicyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_com_coralogix_quota_v1_update_policy_request_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*UpdatePolicyRequest_LogRules)(nil), + (*UpdatePolicyRequest_SpanRules)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_com_coralogix_quota_v1_update_policy_request_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_update_policy_request_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_update_policy_request_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_update_policy_request_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_update_policy_request_proto = out.File + file_com_coralogix_quota_v1_update_policy_request_proto_rawDesc = nil + file_com_coralogix_quota_v1_update_policy_request_proto_goTypes = nil + file_com_coralogix_quota_v1_update_policy_request_proto_depIdxs = nil +} diff --git a/coralogix/clientset/grpc/tco-policies/update_policy_response.pb.go b/coralogix/clientset/grpc/tco-policies/update_policy_response.pb.go new file mode 100644 index 00000000..9e1c31b0 --- /dev/null +++ b/coralogix/clientset/grpc/tco-policies/update_policy_response.pb.go @@ -0,0 +1,152 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.8 +// source: com/coralogix/quota/v1/update_policy_response.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 UpdatePolicyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Policy *Policy `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy,omitempty"` +} + +func (x *UpdatePolicyResponse) Reset() { + *x = UpdatePolicyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_com_coralogix_quota_v1_update_policy_response_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdatePolicyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePolicyResponse) ProtoMessage() {} + +func (x *UpdatePolicyResponse) ProtoReflect() protoreflect.Message { + mi := &file_com_coralogix_quota_v1_update_policy_response_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 UpdatePolicyResponse.ProtoReflect.Descriptor instead. +func (*UpdatePolicyResponse) Descriptor() ([]byte, []int) { + return file_com_coralogix_quota_v1_update_policy_response_proto_rawDescGZIP(), []int{0} +} + +func (x *UpdatePolicyResponse) GetPolicy() *Policy { + if x != nil { + return x.Policy + } + return nil +} + +var File_com_coralogix_quota_v1_update_policy_response_proto protoreflect.FileDescriptor + +var file_com_coralogix_quota_v1_update_policy_response_proto_rawDesc = []byte{ + 0x0a, 0x33, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, + 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x2e, 0x76, 0x31, 0x1a, 0x23, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2f, 0x71, 0x75, 0x6f, + 0x74, 0x61, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x4e, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x6f, 0x67, 0x69, 0x78, 0x2e, 0x71, 0x75, 0x6f, 0x74, 0x61, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_com_coralogix_quota_v1_update_policy_response_proto_rawDescOnce sync.Once + file_com_coralogix_quota_v1_update_policy_response_proto_rawDescData = file_com_coralogix_quota_v1_update_policy_response_proto_rawDesc +) + +func file_com_coralogix_quota_v1_update_policy_response_proto_rawDescGZIP() []byte { + file_com_coralogix_quota_v1_update_policy_response_proto_rawDescOnce.Do(func() { + file_com_coralogix_quota_v1_update_policy_response_proto_rawDescData = protoimpl.X.CompressGZIP(file_com_coralogix_quota_v1_update_policy_response_proto_rawDescData) + }) + return file_com_coralogix_quota_v1_update_policy_response_proto_rawDescData +} + +var file_com_coralogix_quota_v1_update_policy_response_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_com_coralogix_quota_v1_update_policy_response_proto_goTypes = []interface{}{ + (*UpdatePolicyResponse)(nil), // 0: com.coralogix.quota.v1.UpdatePolicyResponse + (*Policy)(nil), // 1: com.coralogix.quota.v1.Policy +} +var file_com_coralogix_quota_v1_update_policy_response_proto_depIdxs = []int32{ + 1, // 0: com.coralogix.quota.v1.UpdatePolicyResponse.policy:type_name -> com.coralogix.quota.v1.Policy + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_com_coralogix_quota_v1_update_policy_response_proto_init() } +func file_com_coralogix_quota_v1_update_policy_response_proto_init() { + if File_com_coralogix_quota_v1_update_policy_response_proto != nil { + return + } + file_com_coralogix_quota_v1_policy_proto_init() + if !protoimpl.UnsafeEnabled { + file_com_coralogix_quota_v1_update_policy_response_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdatePolicyResponse); 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_quota_v1_update_policy_response_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_com_coralogix_quota_v1_update_policy_response_proto_goTypes, + DependencyIndexes: file_com_coralogix_quota_v1_update_policy_response_proto_depIdxs, + MessageInfos: file_com_coralogix_quota_v1_update_policy_response_proto_msgTypes, + }.Build() + File_com_coralogix_quota_v1_update_policy_response_proto = out.File + file_com_coralogix_quota_v1_update_policy_response_proto_rawDesc = nil + file_com_coralogix_quota_v1_update_policy_response_proto_goTypes = nil + file_com_coralogix_quota_v1_update_policy_response_proto_depIdxs = nil +} diff --git a/coralogix/clientset/tco-policies-client.go b/coralogix/clientset/tco-policies-client.go index 8328557c..1e94c07c 100644 --- a/coralogix/clientset/tco-policies-client.go +++ b/coralogix/clientset/tco-policies-client.go @@ -2,43 +2,92 @@ package clientset import ( "context" - "fmt" - "strings" - "terraform-provider-coralogix/coralogix/clientset/rest" + tcopolicies "terraform-provider-coralogix/coralogix/clientset/grpc/tco-policies" ) -type TCOPolicies struct { - client *rest.Client +type TCOPoliciesClient struct { + callPropertiesCreator *CallPropertiesCreator } -func (t TCOPolicies) CreateTCOPolicy(ctx context.Context, jsonContent string) (string, error) { - return t.client.Post(ctx, "/policies", "application/json", jsonContent) +func (t TCOPoliciesClient) CreateTCOPolicy(ctx context.Context, req *tcopolicies.CreatePolicyRequest) (*tcopolicies.CreatePolicyResponse, error) { + callProperties, err := t.callPropertiesCreator.GetCallProperties(ctx) + if err != nil { + return nil, err + } + + conn := callProperties.Connection + defer conn.Close() + client := tcopolicies.NewPoliciesServiceClient(conn) + + return client.CreatePolicy(callProperties.Ctx, req, callProperties.CallOptions...) } -func (t TCOPolicies) GetTCOPolicy(ctx context.Context, id string) (string, error) { - return t.client.Get(ctx, fmt.Sprintf("/policies/%s", id)) +func (t TCOPoliciesClient) GetTCOPolicy(ctx context.Context, req *tcopolicies.GetPolicyRequest) (*tcopolicies.GetPolicyResponse, error) { + callProperties, err := t.callPropertiesCreator.GetCallProperties(ctx) + if err != nil { + return nil, err + } + + conn := callProperties.Connection + defer conn.Close() + client := tcopolicies.NewPoliciesServiceClient(conn) + + return client.GetPolicy(callProperties.Ctx, req, callProperties.CallOptions...) } -func (t TCOPolicies) UpdateTCOPolicy(ctx context.Context, id string, jsonContent string) (string, error) { - return t.client.Put(ctx, fmt.Sprintf("/policies/%s", id), "application/json", jsonContent) +func (t TCOPoliciesClient) UpdateTCOPolicy(ctx context.Context, req *tcopolicies.UpdatePolicyRequest) (*tcopolicies.UpdatePolicyResponse, error) { + callProperties, err := t.callPropertiesCreator.GetCallProperties(ctx) + if err != nil { + return nil, err + } + + conn := callProperties.Connection + defer conn.Close() + client := tcopolicies.NewPoliciesServiceClient(conn) + + return client.UpdatePolicy(callProperties.Ctx, req, callProperties.CallOptions...) } -func (t TCOPolicies) DeleteTCOPolicy(ctx context.Context, id string) error { - _, err := t.client.Delete(ctx, fmt.Sprintf("/policies/%s", id)) - return err +func (t TCOPoliciesClient) DeleteTCOPolicy(ctx context.Context, req *tcopolicies.DeletePolicyRequest) (*tcopolicies.DeletePolicyResponse, error) { + callProperties, err := t.callPropertiesCreator.GetCallProperties(ctx) + if err != nil { + return nil, err + } + + conn := callProperties.Connection + defer conn.Close() + client := tcopolicies.NewPoliciesServiceClient(conn) + + return client.DeletePolicy(callProperties.Ctx, req, callProperties.CallOptions...) } -func (t TCOPolicies) GetTCOPolicies(ctx context.Context) (string, error) { - return t.client.Get(ctx, fmt.Sprintf("/policies")) +func (t TCOPoliciesClient) GetTCOPolicies(ctx context.Context, req *tcopolicies.GetCompanyPoliciesRequest) (*tcopolicies.GetCompanyPoliciesResponse, error) { + callProperties, err := t.callPropertiesCreator.GetCallProperties(ctx) + if err != nil { + return nil, err + } + + conn := callProperties.Connection + defer conn.Close() + client := tcopolicies.NewPoliciesServiceClient(conn) + + return client.GetCompanyPolicies(callProperties.Ctx, req, callProperties.CallOptions...) } -func (t TCOPolicies) ReorderTCOPolicies(ctx context.Context, jsonContent string) (string, error) { - return t.client.Put(ctx, "/policies/reorder", "application/json", jsonContent) +func (t TCOPoliciesClient) ReorderTCOPolicies(ctx context.Context, req *tcopolicies.ReorderPoliciesRequest) (*tcopolicies.ReorderPoliciesResponse, error) { + callProperties, err := t.callPropertiesCreator.GetCallProperties(ctx) + if err != nil { + return nil, err + } + + conn := callProperties.Connection + defer conn.Close() + client := tcopolicies.NewPoliciesServiceClient(conn) + + return client.ReorderPolicies(callProperties.Ctx, req, callProperties.CallOptions...) } -func NewTCOPoliciesClient(c *CallPropertiesCreator) *TCOPolicies { - targetUrl := "https://" + strings.Replace(c.targetUrl, "ng-api-grpc", "webapi", 1) + "/api/v1/external/tco" - client := rest.NewRestClient(targetUrl, c.apiKey) - return &TCOPolicies{client: client} +func NewTCOPoliciesClient(c *CallPropertiesCreator) *TCOPoliciesClient { + return &TCOPoliciesClient{callPropertiesCreator: c} } diff --git a/coralogix/data_source_coralogix_tco_policy.go b/coralogix/data_source_coralogix_tco_policy.go index 85bf460d..8efccc1d 100644 --- a/coralogix/data_source_coralogix_tco_policy.go +++ b/coralogix/data_source_coralogix_tco_policy.go @@ -2,39 +2,95 @@ package coralogix import ( "context" + "fmt" "log" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "terraform-provider-coralogix/coralogix/clientset" + tcopolicies "terraform-provider-coralogix/coralogix/clientset/grpc/tco-policies" + + "google.golang.org/protobuf/types/known/wrapperspb" ) -func dataSourceCoralogixTCOPolicy() *schema.Resource { - tcoPolicySchema := datasourceSchemaFromResourceSchema(TCOPolicySchema()) - tcoPolicySchema["id"] = &schema.Schema{ - Type: schema.TypeString, - Required: true, - } +var _ datasource.DataSourceWithConfigure = &TCOPolicyDataSource{} + +func NewTCOPolicyDataSource() datasource.DataSource { + return &TCOPolicyDataSource{} +} + +type TCOPolicyDataSource struct { + client *clientset.TCOPoliciesClient +} + +func (d *TCOPolicyDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_tco_policy_logs" +} - return &schema.Resource{ - ReadContext: dataSourceCoralogixTCOPolicyRead, +func (d *TCOPolicyDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } - Schema: tcoPolicySchema, + 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.TCOPolicies() +} + +func (d *TCOPolicyDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + var r TCOPolicyResource + var resourceResp resource.SchemaResponse + r.Schema(nil, resource.SchemaRequest{}, &resourceResp) + + resp.Schema = frameworkDatasourceSchemaFromFrameworkResourceSchema(resourceResp.Schema) } -func dataSourceCoralogixTCOPolicyRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - id := d.Get("id").(string) +func (d *TCOPolicyDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var data TCOPolicyResourceModel + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + if resp.Diagnostics.HasError() { + return + } - log.Printf("[INFO] Reading tco-policy %s", id) - tcoPolicy, err := meta.(*clientset.ClientSet).TCOPolicies().GetTCOPolicy(ctx, id) + //Get refreshed tco-policy value from Coralogix + id := data.ID.ValueString() + log.Printf("[INFO] Reading tco-policy: %s", id) + getPolicyResp, err := d.client.GetTCOPolicy(ctx, &tcopolicies.GetPolicyRequest{Id: wrapperspb.String(id)}) if err != nil { log.Printf("[ERROR] Received error: %#v", err) - return handleRpcErrorWithID(err, "tco-policy", id) + if status.Code(err) == codes.NotFound { + data.ID = types.StringNull() + resp.Diagnostics.AddWarning( + fmt.Sprintf("tco-policy %q is in state, but no longer exists in Coralogix backend", id), + fmt.Sprintf("%s will be recreated when you apply", id), + ) + } else { + resp.Diagnostics.AddError( + "Error reading tco-policy", + handleRpcErrorNewFramework(err, "tco-policy"), + ) + } + return } - log.Printf("[INFO] Received tco-policy: %#v", tcoPolicy) + log.Printf("[INFO] Received tco-policy: %#v", getPolicyResp) - d.SetId(id) + data = flattenTCOPolicy(getPolicyResp.GetPolicy()) + + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) + if resp.Diagnostics.HasError() { + return + } - return setTCOPolicy(d, tcoPolicy) + // Save data into Terraform state + resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } diff --git a/coralogix/data_source_coralogix_tco_policy_test.go b/coralogix/data_source_coralogix_tco_policy_test.go index 24d2b88b..2c100f2d 100644 --- a/coralogix/data_source_coralogix_tco_policy_test.go +++ b/coralogix/data_source_coralogix_tco_policy_test.go @@ -10,8 +10,8 @@ var tcoPolicyDataSourceName = "data." + tcoPolicyResourceName1 func TestAccCoralogixDataSourceTCOPolicy_basic(t *testing.T) { resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { Config: testAccCoralogixResourceTCOPolicy() + @@ -25,8 +25,8 @@ func TestAccCoralogixDataSourceTCOPolicy_basic(t *testing.T) { } func testAccCoralogixResourceTCOPolicy_read() string { - return `data "coralogix_tco_policy" "test_1" { - id = coralogix_tco_policy.test_1.id + return `data "coralogix_tco_policy_logs" "test_1" { + id = coralogix_tco_policy_logs.test_1.id } ` } diff --git a/coralogix/provider.go b/coralogix/provider.go index b80fff70..643e40a7 100644 --- a/coralogix/provider.go +++ b/coralogix/provider.go @@ -68,7 +68,6 @@ func OldProvider() *oldSchema.Provider { "coralogix_dashboard": dataSourceCoralogixDashboard(), "coralogix_hosted_dashboard": dataSourceCoralogixHostedDashboard(), "coralogix_recording_rules_groups_set": dataSourceCoralogixRecordingRulesGroupsSet(), - "coralogix_tco_policy": dataSourceCoralogixTCOPolicy(), "coralogix_tco_policy_override": dataSourceCoralogixTCOPolicyOverride(), "coralogix_webhook": dataSourceCoralogixWebhook(), }, @@ -81,7 +80,6 @@ func OldProvider() *oldSchema.Provider { "coralogix_dashboard": resourceCoralogixDashboard(), "coralogix_hosted_dashboard": resourceCoralogixHostedDashboard(), "coralogix_recording_rules_groups_set": resourceCoralogixRecordingRulesGroupsSet(), - "coralogix_tco_policy": resourceCoralogixTCOPolicy(), "coralogix_tco_policy_override": resourceCoralogixTCOPolicyOverride(), "coralogix_webhook": resourceCoralogixWebhook(), }, @@ -282,6 +280,7 @@ func (p *coralogixProvider) DataSources(context.Context) []func() datasource.Dat return []func() datasource.DataSource{ NewEvents2MetricDataSource, NewActionDataSource, + NewTCOPolicyDataSource, } } @@ -289,5 +288,6 @@ func (p *coralogixProvider) Resources(context.Context) []func() resource.Resourc return []func() resource.Resource{ NewEvents2MetricResource, NewActionResource, + NewTCOPolicyResource, } } diff --git a/coralogix/resource_coralogix_action.go b/coralogix/resource_coralogix_action.go index 4e94b6a2..4b05e0c9 100644 --- a/coralogix/resource_coralogix_action.go +++ b/coralogix/resource_coralogix_action.go @@ -149,7 +149,7 @@ func (r *ActionResource) Create(ctx context.Context, req resource.CreateRequest, return } - createActionRequest := extractCreateAction(plan) + createActionRequest := extractCreateAction(plan, ctx) actionStr, _ := jsm.MarshalToString(createActionRequest) log.Printf("[INFO] Creating new action: %s", actionStr) createResp, err := r.client.CreateAction(ctx, createActionRequest) @@ -238,7 +238,7 @@ func (r ActionResource) Update(ctx context.Context, req resource.UpdateRequest, return } - actionUpdateReq := extractUpdateAction(plan) + actionUpdateReq := extractUpdateAction(ctx, plan) log.Printf("[INFO] Updating Action: %#v", actionUpdateReq) actionUpdateResp, err := r.client.UpdateAction(ctx, actionUpdateReq) if err != nil { @@ -314,13 +314,13 @@ type ActionResourceModel struct { IsHidden types.Bool `tfsdk:"is_hidden"` } -func extractCreateAction(plan ActionResourceModel) *actions.CreateActionRequest { +func extractCreateAction(plan ActionResourceModel, ctx context.Context) *actions.CreateActionRequest { name := typeStringToWrapperspbString(plan.Name) url := typeStringToWrapperspbString(plan.URL) isPrivate := wrapperspb.Bool(plan.IsPrivate.ValueBool()) sourceType := actionSchemaSourceTypeToProtoSourceType[plan.SourceType.ValueString()] - applicationNames := typeStringSliceToWrappedStringSlice(plan.Applications.Elements()) - subsystemNames := typeStringSliceToWrappedStringSlice(plan.Subsystems.Elements()) + applicationNames := typeStringSliceToWrappedStringSlice(ctx, plan.Applications.Elements()) + subsystemNames := typeStringSliceToWrappedStringSlice(ctx, plan.Subsystems.Elements()) return &actions.CreateActionRequest{ Name: name, @@ -332,14 +332,14 @@ func extractCreateAction(plan ActionResourceModel) *actions.CreateActionRequest } } -func extractUpdateAction(plan ActionResourceModel) *actions.ReplaceActionRequest { +func extractUpdateAction(ctx context.Context, plan ActionResourceModel) *actions.ReplaceActionRequest { id := wrapperspb.String(plan.ID.ValueString()) name := typeStringToWrapperspbString(plan.Name) url := typeStringToWrapperspbString(plan.URL) isPrivate := wrapperspb.Bool(plan.IsPrivate.ValueBool()) sourceType := actionSchemaSourceTypeToProtoSourceType[plan.SourceType.ValueString()] - applicationNames := typeStringSliceToWrappedStringSlice(plan.Applications.Elements()) - subsystemNames := typeStringSliceToWrappedStringSlice(plan.Subsystems.Elements()) + applicationNames := typeStringSliceToWrappedStringSlice(ctx, plan.Applications.Elements()) + subsystemNames := typeStringSliceToWrappedStringSlice(ctx, plan.Subsystems.Elements()) isHidden := wrapperspb.Bool(plan.IsHidden.ValueBool()) return &actions.ReplaceActionRequest{ diff --git a/coralogix/resource_coralogix_events2metric.go b/coralogix/resource_coralogix_events2metric.go index de23746a..bc583271 100644 --- a/coralogix/resource_coralogix_events2metric.go +++ b/coralogix/resource_coralogix_events2metric.go @@ -1005,7 +1005,7 @@ func extractCreateE2M(ctx context.Context, plan Events2MetricResourceModel) *e2m if spansQuery := plan.SpansQuery; spansQuery != nil { e2mParams.Type = e2m.E2MType_E2M_TYPE_SPANS2METRICS - e2mParams.Query = expandSpansQuery(spansQuery) + e2mParams.Query = expandSpansQuery(ctx, spansQuery) } else if logsQuery := plan.LogsQuery; logsQuery != nil { e2mParams.Type = e2m.E2MType_E2M_TYPE_LOGS2METRICS e2mParams.Query = expandLogsQuery(ctx, logsQuery) @@ -1045,7 +1045,7 @@ func extractUpdateE2M(ctx context.Context, plan Events2MetricResourceModel) *e2m if spansQuery := plan.SpansQuery; spansQuery != nil { e2mParams.Type = e2m.E2MType_E2M_TYPE_SPANS2METRICS - e2mParams.Query = expandUpdateSpansQuery(spansQuery) + e2mParams.Query = expandUpdateSpansQuery(ctx, spansQuery) } else if logsQuery := plan.LogsQuery; logsQuery != nil { e2mParams.Type = e2m.E2MType_E2M_TYPE_LOGS2METRICS e2mParams.Query = expandUpdateLogsQuery(ctx, logsQuery) @@ -1154,12 +1154,12 @@ func expandBuckets(buckets []types.Float64) []float32 { return result } -func expandSpansQuery(spansQuery *SpansQueryModel) *e2m.E2MCreateParams_SpansQuery { +func expandSpansQuery(ctx context.Context, spansQuery *SpansQueryModel) *e2m.E2MCreateParams_SpansQuery { lucene := typeStringToWrapperspbString(spansQuery.Lucene) - applications := typeStringSliceToWrappedStringSlice(spansQuery.Applications.Elements()) - subsystems := typeStringSliceToWrappedStringSlice(spansQuery.Subsystems.Elements()) - actions := typeStringSliceToWrappedStringSlice(spansQuery.Actions.Elements()) - services := typeStringSliceToWrappedStringSlice(spansQuery.Services.Elements()) + applications := typeStringSliceToWrappedStringSlice(ctx, spansQuery.Applications.Elements()) + subsystems := typeStringSliceToWrappedStringSlice(ctx, spansQuery.Subsystems.Elements()) + actions := typeStringSliceToWrappedStringSlice(ctx, spansQuery.Actions.Elements()) + services := typeStringSliceToWrappedStringSlice(ctx, spansQuery.Services.Elements()) return &e2m.E2MCreateParams_SpansQuery{ SpansQuery: &e2m.SpansQuery{ @@ -1174,8 +1174,8 @@ func expandSpansQuery(spansQuery *SpansQueryModel) *e2m.E2MCreateParams_SpansQue func expandLogsQuery(ctx context.Context, logsQuery *LogsQueryModel) *e2m.E2MCreateParams_LogsQuery { searchQuery := typeStringToWrapperspbString(logsQuery.Lucene) - applications := typeStringSliceToWrappedStringSlice(logsQuery.Applications.Elements()) - subsystems := typeStringSliceToWrappedStringSlice(logsQuery.Subsystems.Elements()) + applications := typeStringSliceToWrappedStringSlice(ctx, logsQuery.Applications.Elements()) + subsystems := typeStringSliceToWrappedStringSlice(ctx, logsQuery.Subsystems.Elements()) severities := expandLogsQuerySeverities(ctx, logsQuery.Severities.Elements()) return &e2m.E2MCreateParams_LogsQuery{ @@ -1188,12 +1188,12 @@ func expandLogsQuery(ctx context.Context, logsQuery *LogsQueryModel) *e2m.E2MCre } } -func expandUpdateSpansQuery(spansQuery *SpansQueryModel) *e2m.E2M_SpansQuery { +func expandUpdateSpansQuery(ctx context.Context, spansQuery *SpansQueryModel) *e2m.E2M_SpansQuery { lucene := typeStringToWrapperspbString(spansQuery.Lucene) - applications := typeStringSliceToWrappedStringSlice(spansQuery.Applications.Elements()) - subsystems := typeStringSliceToWrappedStringSlice(spansQuery.Subsystems.Elements()) - actions := typeStringSliceToWrappedStringSlice(spansQuery.Actions.Elements()) - services := typeStringSliceToWrappedStringSlice(spansQuery.Services.Elements()) + applications := typeStringSliceToWrappedStringSlice(ctx, spansQuery.Applications.Elements()) + subsystems := typeStringSliceToWrappedStringSlice(ctx, spansQuery.Subsystems.Elements()) + actions := typeStringSliceToWrappedStringSlice(ctx, spansQuery.Actions.Elements()) + services := typeStringSliceToWrappedStringSlice(ctx, spansQuery.Services.Elements()) return &e2m.E2M_SpansQuery{ SpansQuery: &e2m.SpansQuery{ @@ -1208,8 +1208,8 @@ func expandUpdateSpansQuery(spansQuery *SpansQueryModel) *e2m.E2M_SpansQuery { func expandUpdateLogsQuery(ctx context.Context, logsQuery *LogsQueryModel) *e2m.E2M_LogsQuery { searchQuery := wrapperspb.String(logsQuery.Lucene.ValueString()) - applications := typeStringSliceToWrappedStringSlice(logsQuery.Applications.Elements()) - subsystems := typeStringSliceToWrappedStringSlice(logsQuery.Subsystems.Elements()) + applications := typeStringSliceToWrappedStringSlice(ctx, logsQuery.Applications.Elements()) + subsystems := typeStringSliceToWrappedStringSlice(ctx, logsQuery.Subsystems.Elements()) severities := expandLogsQuerySeverities(ctx, logsQuery.Severities.Elements()) return &e2m.E2M_LogsQuery{ diff --git a/coralogix/resource_coralogix_tco_policy.go b/coralogix/resource_coralogix_tco_policy.go deleted file mode 100644 index 537c7e43..00000000 --- a/coralogix/resource_coralogix_tco_policy.go +++ /dev/null @@ -1,498 +0,0 @@ -package coralogix - -import ( - "context" - "encoding/json" - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "terraform-provider-coralogix/coralogix/clientset" -) - -var ( - tcoPolicyResponseFilterTypeToTcoPolicySchemaFilterType = map[string]string{ - "Starts With": "starts_with", - "Is": "is", - "Is Not": "is_not", - "Includes": "includes", - } - validPolicyPriorities = []string{"high", "medium", "low", "block"} - tcoPolicySchemaSeverityToTcoPolicyRequestSeverity = map[string]int{ - "debug": 1, - "verbose": 2, - "info": 3, - "warning": 4, - "error": 5, - "critical": 6, - } - tcoPolicyResponseSeverityToTcoPolicySchemaSeverity = reverseMapIntToString(tcoPolicySchemaSeverityToTcoPolicyRequestSeverity) - validPolicySeverities = getKeysInt(tcoPolicySchemaSeverityToTcoPolicyRequestSeverity) -) - -type tcoPolicyRequest struct { - Name string `json:"name"` - Priority string `json:"priority"` - Enabled bool `json:"enabled,omitempty"` - Order *int `json:"order,omitempty"` - ApplicationName *tcoPolicyFilter `json:"applicationName,omitempty"` - SubsystemName *tcoPolicyFilter `json:"subsystemName,omitempty"` - Severities *[]int `json:"severities,omitempty"` - ArchiveRetention *archiveRetention `json:"archiveRetention,omitempty"` -} - -type tcoPolicyFilter struct { - Type string `json:"type"` - Rule interface{} `json:"rule"` -} - -type archiveRetention struct { - Id string `json:"archiveRetentionId"` -} - -func resourceCoralogixTCOPolicy() *schema.Resource { - return &schema.Resource{ - CreateContext: resourceCoralogixTCOPolicyCreate, - ReadContext: resourceCoralogixTCOPolicyRead, - UpdateContext: resourceCoralogixTCOPolicyUpdate, - DeleteContext: resourceCoralogixTCOPolicyDelete, - - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, - - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(60 * time.Second), - Read: schema.DefaultTimeout(30 * time.Second), - Update: schema.DefaultTimeout(60 * time.Second), - Delete: schema.DefaultTimeout(30 * time.Second), - }, - - Schema: TCOPolicySchema(), - - Description: "Coralogix TCO-Policy. For more information - https://coralogix.com/docs/tco-optimizer-api .", - } -} - -func resourceCoralogixTCOPolicyCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - tcoPolicyReq, err := extractTCOPolicyRequest(d) - if err != nil { - return diag.FromErr(err) - } - - log.Printf("[INFO] Creating new tco-policy: %#v", tcoPolicyReq) - tcoPolicyResp, err := meta.(*clientset.ClientSet).TCOPolicies().CreateTCOPolicy(ctx, tcoPolicyReq) - if err != nil { - log.Printf("[ERROR] Received error: %#v", err) - return handleRpcError(err, "tco-policy") - } - - log.Printf("[INFO] Submitted new tco-policy: %#v", tcoPolicyResp) - - var m map[string]interface{} - if err = json.Unmarshal([]byte(tcoPolicyResp), &m); err != nil { - return diag.FromErr(err) - } - - d.SetId(m["id"].(string)) - - if err = updatePoliciesOrder(ctx, d, meta); err != nil { - return diag.FromErr(err) - } - - return resourceCoralogixTCOPolicyRead(ctx, d, meta) -} - -func updatePoliciesOrder(ctx context.Context, d *schema.ResourceData, meta interface{}) error { - tcoPoliciesResp, err := meta.(*clientset.ClientSet).TCOPolicies().GetTCOPolicies(ctx) - var policies []map[string]interface{} - if err = json.Unmarshal([]byte(tcoPoliciesResp), &policies); err != nil { - return err - } - - policiesOrders := make([]string, len(policies)) - currentIndex := -1 - for i, policy := range policies { - id := policy["id"].(string) - policiesOrders[i] = id - if id == d.Id() { - currentIndex = i - } - } - desiredIndex := d.Get("order").(int) - 1 - if desiredIndex >= len(policies) { - desiredIndex = len(policies) - 1 - } - if currentIndex == desiredIndex { - return nil - } - policiesOrders[currentIndex], policiesOrders[desiredIndex] = policiesOrders[desiredIndex], policiesOrders[currentIndex] - - reorderRequest, err := json.Marshal(policiesOrders) - if _, err = meta.(*clientset.ClientSet).TCOPolicies().ReorderTCOPolicies(ctx, string(reorderRequest)); err != nil { - return err - } - - return nil -} - -func resourceCoralogixTCOPolicyRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - id := d.Id() - log.Printf("[INFO] Reading tco-policy %s", id) - tcoPolicyResp, err := meta.(*clientset.ClientSet).TCOPolicies().GetTCOPolicy(ctx, id) - if err != nil { - log.Printf("[ERROR] Received error: %#v", err) - if status.Code(err) == codes.NotFound { - d.SetId("") - return diag.Diagnostics{diag.Diagnostic{ - Severity: diag.Warning, - Summary: fmt.Sprintf("Tco-Policy %q is in state, but no longer exists in Coralogix backend", id), - Detail: fmt.Sprintf("%s will be recreated when you apply", id), - }} - } - } - - log.Printf("[INFO] Received tco-policy: %#v", tcoPolicyResp) - - return setTCOPolicy(d, tcoPolicyResp) -} - -func resourceCoralogixTCOPolicyUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - tcoPolicyReq, err := extractTCOPolicyRequest(d) - if err != nil { - return diag.FromErr(err) - } - - id := d.Id() - log.Printf("[INFO] Updating tco-policy %s to %s", id, tcoPolicyReq) - tcoPolicyResp, err := meta.(*clientset.ClientSet).TCOPolicies().UpdateTCOPolicy(ctx, id, tcoPolicyReq) - if err != nil { - log.Printf("[ERROR] Received error: %#v", err) - return handleRpcError(err, "tco-policy") - } - - log.Printf("[INFO] Submitted new tco-policy: %#v", tcoPolicyResp) - - var m map[string]interface{} - if err = json.Unmarshal([]byte(tcoPolicyResp), &m); err != nil { - return diag.FromErr(err) - } - - d.SetId(m["id"].(string)) - - if err = updatePoliciesOrder(ctx, d, meta); err != nil { - return diag.FromErr(err) - } - - return resourceCoralogixTCOPolicyRead(ctx, d, meta) -} - -func resourceCoralogixTCOPolicyDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - id := d.Id() - - log.Printf("[INFO] Deleting tco-policy %s", id) - err := meta.(*clientset.ClientSet).TCOPolicies().DeleteTCOPolicy(ctx, id) - if err != nil { - log.Printf("[ERROR] Received error: %#v", err) - return handleRpcErrorWithID(err, "tco-policy", id) - } - log.Printf("[INFO] tco-policy %s deleted", id) - - d.SetId("") - return nil -} - -func extractTCOPolicyRequest(d *schema.ResourceData) (string, error) { - name := d.Get("name").(string) - enable := d.Get("enabled").(bool) - priority := d.Get("priority").(string) - severities := expandTCOPolicySeverities(d.Get("severities")) - applicationName := expandTCOPolicyFilter(d.Get("application_name")) - subsystemName := expandTCOPolicyFilter(d.Get("subsystem_name")) - archiveRetention := expandActiveRetention(d.Get("archive_retention_id")) - - reqStruct := tcoPolicyRequest{ - Name: name, - Enabled: enable, - Priority: priority, - Severities: severities, - ApplicationName: applicationName, - SubsystemName: subsystemName, - ArchiveRetention: archiveRetention, - } - - requestJson, err := json.Marshal(reqStruct) - if err != nil { - return "", err - } - - return string(requestJson), nil -} - -func expandActiveRetention(v interface{}) *archiveRetention { - if v == nil || v == "" { - return nil - } - return &archiveRetention{ - Id: v.(string), - } -} - -func expandTCOPolicyFilter(v interface{}) *tcoPolicyFilter { - l := v.([]interface{}) - if len(l) == 0 { - return nil - } - m := l[0].(map[string]interface{}) - - filterType := expandTcoPolicyFilterType(m) - rule := expandTcoPolicyFilterRule(m) - - return &tcoPolicyFilter{ - Type: filterType, - Rule: rule, - } -} - -func expandTcoPolicyFilterRule(m map[string]interface{}) interface{} { - if rules, ok := m["rules"]; ok && rules != nil { - rulesList := rules.(*schema.Set).List() - if len(rulesList) == 0 { - return m["rule"].(string) - } else { - return rulesList - } - } - return m["rule"].(string) -} - -func expandTcoPolicyFilterType(m map[string]interface{}) string { - var filterType string - if is, ok := m["is"]; ok && is.(bool) { - filterType = "Is" - } else if isNot, ok := m["is_not"]; ok && isNot.(bool) { - filterType = "Is Not" - } else if starsWith, ok := m["starts_with"]; ok && starsWith.(bool) { - filterType = "Starts With" - } else { - filterType = "Includes" - } - return filterType -} - -func expandTCOPolicySeverities(v interface{}) *[]int { - if v == nil { - return nil - } - severities := v.(*schema.Set).List() - result := make([]int, 0, len(severities)) - for _, severity := range severities { - s := tcoPolicySchemaSeverityToTcoPolicyRequestSeverity[severity.(string)] - result = append(result, s) - } - return &result -} - -func setTCOPolicy(d *schema.ResourceData, tcoPolicyResp string) diag.Diagnostics { - var m map[string]interface{} - if err := json.Unmarshal([]byte(tcoPolicyResp), &m); err != nil { - return diag.FromErr(err) - } - - var diags diag.Diagnostics - if err := d.Set("name", m["name"].(string)); err != nil { - diags = append(diags, diag.FromErr(err)...) - } - if err := d.Set("enabled", m["enabled"].(bool)); err != nil { - diags = append(diags, diag.FromErr(err)...) - } - if err := d.Set("order", int(m["order"].(float64))); err != nil { - diags = append(diags, diag.FromErr(err)...) - } - if err := d.Set("priority", m["priority"].(string)); err != nil { - diags = append(diags, diag.FromErr(err)...) - } - if err := d.Set("severities", flattenTCOPolicySeverities(m["severities"])); err != nil { - diags = append(diags, diag.FromErr(err)...) - } - if err := d.Set("application_name", flattenTCOPolicyFilter(m["applicationName"])); err != nil { - diags = append(diags, diag.FromErr(err)...) - } - if err := d.Set("subsystem_name", flattenTCOPolicyFilter(m["subsystemName"])); err != nil { - diags = append(diags, diag.FromErr(err)...) - } - if err := d.Set("archive_retention_id", flattenArchiveRetention(m["archiveRetention"])); err != nil { - - } - return diags -} - -func flattenArchiveRetention(v interface{}) interface{} { - if v == nil { - return nil - } - archiveRetention := v.(map[string]interface{}) - return archiveRetention["archiveRetentionId"].(string) -} - -func flattenTCOPolicySeverities(v interface{}) interface{} { - if v == nil { - return nil - } - - severities := v.([]interface{}) - result := make([]string, 0, len(severities)) - for _, severity := range severities { - severityStr := tcoPolicyResponseSeverityToTcoPolicySchemaSeverity[int(severity.(float64))] - result = append(result, severityStr) - } - - return result -} - -func flattenTCOPolicyFilter(v interface{}) interface{} { - if v == nil { - return nil - } - filter := v.(map[string]interface{}) - - filterType := tcoPolicyResponseFilterTypeToTcoPolicySchemaFilterType[filter["type"].(string)] - flattenedFilter := map[string]interface{}{ - filterType: true, - } - - if rules, ok := filter["rule"].([]interface{}); ok { - flattenedFilter["rules"] = interfaceSliceToStringSlice(rules) - } else { - flattenedFilter["rule"] = filter["rule"].(string) - } - - return []interface{}{flattenedFilter} -} - -func TCOPolicySchema() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringIsNotEmpty, - Description: "The policy name. Have to be unique per policy.", - }, - "enabled": { - Type: schema.TypeBool, - Optional: true, - Default: true, - Description: "Determines weather the policy will be enabled. True by default.", - }, - "priority": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice(validPolicyPriorities, false), - Description: fmt.Sprintf("The policy priority. Can be one of %q.", validPolicyPriorities), - }, - "order": { - Type: schema.TypeInt, - Required: true, - ValidateFunc: validation.IntAtLeast(1), - Description: "Determines the policy's order between the other policies. Currently, will be computed by creation order.", - }, - "severities": { - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - ValidateFunc: validation.StringInSlice(validPolicySeverities, false), - }, - Set: schema.HashString, - MinItems: 1, - Description: fmt.Sprintf("The severities to apply the policy on. Can be few of %q.", validPolicySeverities), - }, - "application_name": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Elem: tcoPolicyFiltersSchema("application_name"), - Description: "The applications to apply the policy on. Applies the policy on all the applications by default.", - }, - "subsystem_name": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Elem: tcoPolicyFiltersSchema("subsystem_name"), - Description: "The subsystems to apply the policy on. Applies the policy on all the subsystems by default.", - }, - "archive_retention_id": { - Type: schema.TypeString, - Optional: true, - Description: "Allowing logs with a specific retention to be tagged.", - ValidateFunc: validation.StringIsNotEmpty, - }, - } -} - -func tcoPolicyFiltersSchema(filterName string) *schema.Resource { - filterTypesRoutes := filterTypesRoutes(filterName) - return &schema.Resource{ - Schema: map[string]*schema.Schema{ - "is": { - Type: schema.TypeBool, - Optional: true, - ExactlyOneOf: filterTypesRoutes, - RequiredWith: []string{fmt.Sprintf("%s.0.rules", filterName)}, - Description: "Determines the filter's type. One of is/is_not/starts_with/includes have to be set.", - }, - "is_not": { - Type: schema.TypeBool, - Optional: true, - ExactlyOneOf: filterTypesRoutes, - RequiredWith: []string{fmt.Sprintf("%s.0.rules", filterName)}, - Description: "Determines the filter's type. One of is/is_not/starts_with/includes have to be set.", - }, - "starts_with": { - Type: schema.TypeBool, - Optional: true, - ExactlyOneOf: filterTypesRoutes, - RequiredWith: []string{fmt.Sprintf("%s.0.rule", filterName)}, - Description: "Determines the filter's type. One of is/is_not/starts_with/includes have to be set.", - }, - "includes": { - Type: schema.TypeBool, - Optional: true, - ExactlyOneOf: filterTypesRoutes, - RequiredWith: []string{fmt.Sprintf("%s.0.rule", filterName)}, - Description: "Determines the filter's type. One of is/is_not/starts_with/includes have to be set.", - }, - "rules": { - Type: schema.TypeSet, - Optional: true, - MinItems: 1, - Elem: &schema.Schema{ - Type: schema.TypeString, - Set: schema.HashString, - }, - ExactlyOneOf: []string{fmt.Sprintf("%s.0.rule", filterName), fmt.Sprintf("%s.0.rules", filterName)}, - Description: "Set of rules to apply the filter on. In case of is=true/is_not=true replace to 'rules' (set of strings).", - }, - "rule": { - Type: schema.TypeString, - Optional: true, - ExactlyOneOf: []string{fmt.Sprintf("%s.0.rule", filterName), fmt.Sprintf("%s.0.rules", filterName)}, - Description: "Single rule to apply the filter on. In case of start_with=true/includes=true replace to 'rule' (single string).", - }, - }, - } -} - -func filterTypesRoutes(filterName string) []string { - return []string{ - fmt.Sprintf("%s.0.is", filterName), - fmt.Sprintf("%s.0.is_not", filterName), - fmt.Sprintf("%s.0.starts_with", filterName), - fmt.Sprintf("%s.0.includes", filterName), - } -} diff --git a/coralogix/resource_coralogix_tco_policy_logs.go b/coralogix/resource_coralogix_tco_policy_logs.go new file mode 100644 index 00000000..c88b7e93 --- /dev/null +++ b/coralogix/resource_coralogix_tco_policy_logs.go @@ -0,0 +1,814 @@ +package coralogix + +import ( + "context" + "fmt" + "log" + "strings" + + "github.com/golang/protobuf/jsonpb" + "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/attr" + "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/booldefault" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" + "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/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/wrapperspb" + "terraform-provider-coralogix/coralogix/clientset" + tcopolicies "terraform-provider-coralogix/coralogix/clientset/grpc/tco-policies" +) + +var ( + _ resource.ResourceWithConfigure = &TCOPolicyResource{} + _ resource.ResourceWithImportState = &TCOPolicyResource{} + _ resource.ResourceWithUpgradeState = &TCOPolicyResource{} + tcoPoliciesPrioritySchemaToProto = map[string]tcopolicies.Priority{ + "block": tcopolicies.Priority_PRIORITY_TYPE_BLOCK, + "high": tcopolicies.Priority_PRIORITY_TYPE_HIGH, + "low": tcopolicies.Priority_PRIORITY_TYPE_LOW, + "medium": tcopolicies.Priority_PRIORITY_TYPE_MEDIUM, + } + tcoPoliciesPriorityProtoToSchema = ReverseMap(tcoPoliciesPrioritySchemaToProto) + tcoPoliciesValidPriorities = GetKeys(tcoPoliciesPrioritySchemaToProto) + tcoPoliciesRuleTypeSchemaToProto = map[string]tcopolicies.RuleTypeId{ + "is": tcopolicies.RuleTypeId_RULE_TYPE_ID_IS, + "is_not": tcopolicies.RuleTypeId_RULE_TYPE_ID_IS_NOT, + "starts_with": tcopolicies.RuleTypeId_RULE_TYPE_ID_START_WITH, + "includes": tcopolicies.RuleTypeId_RULE_TYPE_ID_INCLUDES, + } + tcoPoliciesRuleTypeProtoToSchema = ReverseMap(tcoPoliciesRuleTypeSchemaToProto) + tcoPoliciesValidRuleTypes = GetKeys(tcoPoliciesRuleTypeSchemaToProto) + tcoPolicySeveritySchemaToProto = map[string]tcopolicies.Severity{ + "debug": tcopolicies.Severity_SEVERITY_DEBUG, + "verbose": tcopolicies.Severity_SEVERITY_VERBOSE, + "info": tcopolicies.Severity_SEVERITY_INFO, + "warning": tcopolicies.Severity_SEVERITY_WARNING, + "error": tcopolicies.Severity_SEVERITY_ERROR, + "critical": tcopolicies.Severity_SEVERITY_CRITICAL, + } + tcoPolicySeverityProtoToSchema = ReverseMap(tcoPolicySeveritySchemaToProto) + validPolicySeverities = GetKeys(tcoPolicySeveritySchemaToProto) + jsm = &jsonpb.Marshaler{} +) + +func NewTCOPolicyResource() resource.Resource { + return &TCOPolicyResource{} +} + +type TCOPolicyResource struct { + client *clientset.TCOPoliciesClient +} + +type TCOPolicyResourceModel struct { + ID types.String `tfsdk:"id"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + Enabled types.Bool `tfsdk:"enabled"` + Order types.Int64 `tfsdk:"order"` + Priority types.String `tfsdk:"priority"` + Applications *TCORuleModel `tfsdk:"applications"` + Subsystems *TCORuleModel `tfsdk:"subsystems"` + Severities types.Set `tfsdk:"severities"` + ArchiveRetentionID types.String `tfsdk:"archive_retention_id"` +} + +type TCORuleModel struct { + RuleType types.String `tfsdk:"rule_type"` + Names types.Set `tfsdk:"names"` +} + +func (r *TCOPolicyResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_tco_policy_logs" +} + +func (r *TCOPolicyResource) 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.TCOPolicies() +} + +func (r *TCOPolicyResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + Version: 1, + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: "tco-policy ID.", + }, + "name": schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthAtLeast(1), + }, + MarkdownDescription: "tco-policy name.", + }, + "description": schema.StringAttribute{ + Optional: true, + Computed: true, + Default: stringdefault.StaticString(""), + MarkdownDescription: "The policy description", + }, + "enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + Default: booldefault.StaticBool(true), + MarkdownDescription: "Determines weather the policy will be enabled. True by default.", + }, + "priority": schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.OneOf(tcoPoliciesValidPriorities...), + }, + MarkdownDescription: fmt.Sprintf("The policy priority. Can be one of %q.", tcoPoliciesValidPriorities), + }, + "order": schema.Int64Attribute{ + Required: true, + Validators: []validator.Int64{ + int64validator.AtLeast(1), + }, + MarkdownDescription: "Determines the policy's order between the other policies.", + }, + "archive_retention_id": schema.StringAttribute{ + Optional: true, + Description: "Allowing logs with a specific retention to be tagged.", + Validators: []validator.String{ + stringvalidator.LengthAtLeast(1), + }, + }, + "severities": schema.SetAttribute{ + Optional: true, + ElementType: types.StringType, + Validators: []validator.Set{ + setvalidator.SizeAtLeast(1), + setvalidator.ValueStringsAre(stringvalidator.OneOf(validPolicySeverities...)), + }, + MarkdownDescription: fmt.Sprintf("The severities to apply the policy on. Can be few of %q.", validPolicySeverities), + }, + "applications": schema.SingleNestedAttribute{ + Optional: true, + Attributes: map[string]schema.Attribute{ + "names": schema.SetAttribute{ + Required: true, + ElementType: types.StringType, + Validators: []validator.Set{ + setvalidator.SizeAtLeast(1), + }, + }, + "rule_type": schema.StringAttribute{ + Optional: true, + Computed: true, + Default: stringdefault.StaticString("is"), + Validators: []validator.String{ + stringvalidator.OneOf(tcoPoliciesValidRuleTypes...), + }, + MarkdownDescription: fmt.Sprintf("The rule type. Can be one of %q.", tcoPoliciesValidRuleTypes), + }, + }, + MarkdownDescription: "The applications to apply the policy on. Applies the policy on all the applications by default.", + }, + "subsystems": schema.SingleNestedAttribute{ + Optional: true, + Attributes: map[string]schema.Attribute{ + "names": schema.SetAttribute{ + Required: true, + ElementType: types.StringType, + Validators: []validator.Set{ + setvalidator.SizeAtLeast(1), + }, + }, + "rule_type": schema.StringAttribute{ + Optional: true, + Computed: true, + Default: stringdefault.StaticString("is"), + Validators: []validator.String{ + stringvalidator.OneOf(tcoPoliciesValidRuleTypes...), + }, + }, + }, + MarkdownDescription: "The subsystems to apply the policy on. Applies the policy on all the subsystems by default.", + }, + }, + MarkdownDescription: "Coralogix TCO-Policy. For more information - https://coralogix.com/docs/tco-optimizer-api .", + } +} + +func (r *TCOPolicyResource) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, resp *resource.ValidateConfigResponse) { + var data TCOPolicyResourceModel + + resp.Diagnostics.Append(req.Config.Get(ctx, &data)...) + + if resp.Diagnostics.HasError() { + return + } + + validateTCORuleModelModel(data.Subsystems, "subsystems", resp) + + validateTCORuleModelModel(data.Applications, "applications", resp) +} + +func validateTCORuleModelModel(rule *TCORuleModel, root string, resp *resource.ValidateConfigResponse) { + if rule != nil { + ruleType := rule.RuleType.ValueString() + nameLength := len(rule.Names.Elements()) + if (ruleType == "starts_with" || ruleType == "includes") && nameLength > 1 { + resp.Diagnostics.AddAttributeWarning( + path.Root(root), + "Conflicting Attributes Values Configuration", + fmt.Sprintf("Currently, rule_type \"%s\" is supportred with only one value, but \"names\" includes %d elements.", ruleType, nameLength), + ) + } + } +} + +func (r *TCOPolicyResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + +} + +func (r *TCOPolicyResource) UpgradeState(_ context.Context) map[int64]resource.StateUpgrader { + schemaV0 := tcoPolicySchemaV0() + return map[int64]resource.StateUpgrader{ + 0: { + PriorSchema: &schemaV0, + StateUpgrader: upgradeTcoPolicyStateV0ToV1, + }, + } +} + +func upgradeTcoPolicyStateV0ToV1(ctx context.Context, req resource.UpgradeStateRequest, resp *resource.UpgradeStateResponse) { + type TCOPolicyResourceModelV0 struct { + ID types.String `tfsdk:"id"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + Enabled types.Bool `tfsdk:"enabled"` + Order types.Int64 `tfsdk:"order"` + Priority types.String `tfsdk:"priority"` + ApplicationName types.List `tfsdk:"application_name"` + SubsystemName types.List `tfsdk:"subsystem_name"` + Severities types.Set `tfsdk:"severities"` + ArchiveRetentionID types.String `tfsdk:"archive_retention_id"` + } + + var priorStateData TCOPolicyResourceModelV0 + resp.Diagnostics.Append(req.State.Get(ctx, &priorStateData)...) + if resp.Diagnostics.HasError() { + return + } + + upgradedStateData := TCOPolicyResourceModel{ + ID: priorStateData.ID, + Name: priorStateData.Name, + Description: priorStateData.Description, + Enabled: priorStateData.Enabled, + Order: priorStateData.Order, + Priority: priorStateData.Priority, + Applications: upgradeTCOPolicyRuleV0ToV1(ctx, priorStateData.ApplicationName), + Subsystems: upgradeTCOPolicyRuleV0ToV1(ctx, priorStateData.SubsystemName), + Severities: priorStateData.Severities, + ArchiveRetentionID: priorStateData.ArchiveRetentionID, + } + + resp.Diagnostics.Append(resp.State.Set(ctx, upgradedStateData)...) +} + +func upgradeTCOPolicyRuleV0ToV1(ctx context.Context, tCOPolicyRule types.List) *TCORuleModel { + var tCOPolicyRuleObjects []types.Object + tCOPolicyRule.ElementsAs(ctx, &tCOPolicyRuleObjects, true) + if len(tCOPolicyRuleObjects) == 0 { + return nil + } + + var tCORuleModelObjectV0 TCORuleModelV0 + tCOPolicyRuleObjects[0].As(ctx, &tCORuleModelObjectV0, basetypes.ObjectAsOptions{}) + + tCORuleModelObjectV1 := &TCORuleModel{} + if tCORuleModelObjectV0.Is.ValueBool() { + tCORuleModelObjectV1.RuleType = types.StringValue("is") + } else if tCORuleModelObjectV0.IsNot.ValueBool() { + tCORuleModelObjectV1.RuleType = types.StringValue("is_not") + } else if tCORuleModelObjectV0.Include.ValueBool() { + tCORuleModelObjectV1.RuleType = types.StringValue("includes") + } else if tCORuleModelObjectV0.StartsWith.ValueBool() { + tCORuleModelObjectV1.RuleType = types.StringValue("starts_with") + } + + if rule := tCORuleModelObjectV0.Rule.ValueString(); rule != "" { + elements := []attr.Value{types.StringValue(rule)} + tCORuleModelObjectV1.Names = types.SetValueMust(types.StringType, elements) + } else { + rules := tCORuleModelObjectV0.Rules.Elements() + elements := make([]attr.Value, 0, len(rules)) + for _, rule := range rules { + elements = append(elements, rule) + } + tCORuleModelObjectV1.Names = types.SetValueMust(types.StringType, elements) + } + + return tCORuleModelObjectV1 +} + +type TCORuleModelV0 struct { + Is types.Bool `tfsdk:"is"` + IsNot types.Bool `tfsdk:"is_not"` + Include types.Bool `tfsdk:"include"` + StartsWith types.Bool `tfsdk:"starts_with"` + Rule types.String `tfsdk:"rule"` + Rules types.Set `tfsdk:"rules"` +} + +func tcoPolicySchemaV0() schema.Schema { + return schema.Schema{ + Version: 0, + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + MarkdownDescription: "tco-policy ID.", + }, + "name": schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.LengthAtLeast(1), + }, + MarkdownDescription: "tco-policy name.", + }, + "description": schema.StringAttribute{ + Optional: true, + Computed: true, + Default: stringdefault.StaticString(""), + }, + "enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + Default: booldefault.StaticBool(true), + MarkdownDescription: "Determines weather the policy will be enabled. True by default.", + }, + "priority": schema.StringAttribute{ + Required: true, + Validators: []validator.String{ + stringvalidator.OneOf(tcoPoliciesValidPriorities...), + }, + MarkdownDescription: fmt.Sprintf("The policy priority. Can be one of %q.", tcoPoliciesValidPriorities), + }, + "order": schema.Int64Attribute{ + Required: true, + Validators: []validator.Int64{ + int64validator.AtLeast(1), + }, + Description: "Determines the policy's order between the other policies. Currently, will be computed by creation order.", + }, + "archive_retention_id": schema.StringAttribute{ + Optional: true, + Description: "Allowing logs with a specific retention to be tagged.", + Validators: []validator.String{ + stringvalidator.LengthAtLeast(1), + }, + }, + "severities": schema.SetAttribute{ + Optional: true, + ElementType: types.StringType, + Validators: []validator.Set{ + setvalidator.SizeAtLeast(1), + setvalidator.ValueStringsAre(stringvalidator.OneOf(validPolicySeverities...)), + }, + MarkdownDescription: fmt.Sprintf("The severities to apply the policy on. Can be few of %q.", validPolicySeverities), + }, + }, + Blocks: map[string]schema.Block{ + "application_name": schema.ListNestedBlock{ + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "starts_with": schema.BoolAttribute{}, + "is": schema.BoolAttribute{}, + "is_not": schema.BoolAttribute{}, + "includes": schema.BoolAttribute{}, + "rule": schema.StringAttribute{}, + "rules": schema.SetAttribute{ + ElementType: types.StringType, + }, + }, + }, + }, + "subsystem_name": schema.ListNestedBlock{ + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "starts_with": schema.BoolAttribute{}, + "is": schema.BoolAttribute{}, + "is_not": schema.BoolAttribute{}, + "includes": schema.BoolAttribute{}, + "rule": schema.StringAttribute{}, + "rules": schema.SetAttribute{ + ElementType: types.StringType, + }, + }, + }, + }, + }, + } +} + +func (r *TCOPolicyResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan TCOPolicyResourceModel + diags := req.Plan.Get(ctx, &plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + createPolicyRequest := extractCreateTcoPolicy(ctx, plan) + policyStr, _ := jsm.MarshalToString(createPolicyRequest) + log.Printf("[INFO] Creating new tco-policy: %s", policyStr) + createResp, err := r.client.CreateTCOPolicy(ctx, createPolicyRequest) + if err != nil { + log.Printf("[ERROR] Received error: %#v", err) + resp.Diagnostics.AddError( + "Error creating tco-policy", + "Could not create tco-policy, unexpected error: "+err.Error(), + ) + return + } + policy := createResp.GetPolicy() + policyStr, _ = jsm.MarshalToString(policy) + log.Printf("[INFO] Submitted new tco-policy: %#v", policy) + plan.ID = types.StringValue(createResp.GetPolicy().GetId().GetValue()) + r.updatePoliciesOrder(ctx, plan) + + policy.Order = wrapperspb.Int32(int32(plan.Order.ValueInt64())) + plan = flattenTCOPolicy(policy) + + // Set state to fully populated data + diags = resp.State.Set(ctx, plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } +} + +func (r *TCOPolicyResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state TCOPolicyResourceModel + diags := req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + //Get refreshed tco-policy value from Coralogix + id := state.ID.ValueString() + log.Printf("[INFO] Reading tco-policy: %s", id) + getPolicyResp, err := r.client.GetTCOPolicy(ctx, &tcopolicies.GetPolicyRequest{Id: wrapperspb.String(id)}) + if err != nil { + log.Printf("[ERROR] Received error: %#v", err) + if status.Code(err) == codes.NotFound { + state.ID = types.StringNull() + resp.Diagnostics.AddWarning( + fmt.Sprintf("tco-policy %q is in state, but no longer exists in Coralogix backend", id), + fmt.Sprintf("%s will be recreated when you apply", id), + ) + } else { + resp.Diagnostics.AddError( + "Error reading tco-policy", + handleRpcErrorNewFramework(err, "tco-policy"), + ) + } + return + } + policy := getPolicyResp.GetPolicy() + log.Printf("[INFO] Received tco-policy: %#v", policy) + + state = flattenTCOPolicy(policy) + // + diags = resp.State.Set(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } +} + +func (r TCOPolicyResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + // Retrieve values from plan + var plan TCOPolicyResourceModel + diags := req.Plan.Get(ctx, &plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + policyUpdateReq := extractUpdateTCOPolicy(ctx, plan) + log.Printf("[INFO] Updating tco-policy: %#v", policyUpdateReq) + policyUpdateResp, err := r.client.UpdateTCOPolicy(ctx, policyUpdateReq) + if err != nil { + log.Printf("[ERROR] Received error: %#v", err) + resp.Diagnostics.AddError( + "Error updating tco-policy", + "Could not update tco-policy, unexpected error: "+err.Error(), + ) + return + } + log.Printf("[INFO] Submitted updated tco-policy: %#v", policyUpdateResp) + + r.updatePoliciesOrder(ctx, plan) + + // Get refreshed tco-policy value from Coralogix + id := plan.ID.ValueString() + getPolicyResp, err := r.client.GetTCOPolicy(ctx, &tcopolicies.GetPolicyRequest{Id: wrapperspb.String(id)}) + if err != nil { + log.Printf("[ERROR] Received error: %#v", err) + if status.Code(err) == codes.NotFound { + plan.ID = types.StringNull() + resp.Diagnostics.AddWarning( + fmt.Sprintf("tco-policy %q is in state, but no longer exists in Coralogix backend", id), + fmt.Sprintf("%s will be recreated when you apply", id), + ) + } else { + resp.Diagnostics.AddError( + "Error reading tco-policy", + handleRpcErrorNewFramework(err, "tco-policy"), + ) + } + return + } + log.Printf("[INFO] Received tco-policy: %#v", getPolicyResp) + + plan = flattenTCOPolicy(getPolicyResp.GetPolicy()) + + // Set state to fully populated data + diags = resp.State.Set(ctx, plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } +} + +func (r TCOPolicyResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state TCOPolicyResourceModel + diags := req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + id := state.ID.ValueString() + log.Printf("[INFO] Deleting tco-policy %s\n", id) + if _, err := r.client.DeleteTCOPolicy(ctx, &tcopolicies.DeletePolicyRequest{Id: wrapperspb.String(id)}); err != nil { + resp.Diagnostics.AddError( + fmt.Sprintf("Error Deleting tco-policy %s", state.ID.ValueString()), + handleRpcErrorNewFramework(err, "tco-policy"), + ) + return + } + log.Printf("[INFO] tco-policy %s deleted\n", id) +} + +func flattenTCOPolicy(policy *tcopolicies.Policy) TCOPolicyResourceModel { + logRules := policy.GetSourceTypeRules().(*tcopolicies.Policy_LogRules).LogRules + tcoPolicy := TCOPolicyResourceModel{ + ID: types.StringValue(policy.GetId().GetValue()), + Name: types.StringValue(policy.GetName().GetValue()), + Description: types.StringValue(policy.GetDescription().GetValue()), + Enabled: types.BoolValue(policy.GetEnabled().GetValue()), + Order: types.Int64Value(int64(policy.GetOrder().GetValue())), + Priority: types.StringValue(tcoPoliciesPriorityProtoToSchema[policy.GetPriority()]), + Applications: flattenTCOPolicyRule(policy.GetApplicationRule()), + Subsystems: flattenTCOPolicyRule(policy.GetSubsystemRule()), + ArchiveRetentionID: flattenArchiveRetention(policy.GetArchiveRetention()), + Severities: flattenTCOPolicySeverities(logRules.GetSeverities()), + } + + return tcoPolicy +} + +func flattenTCOPolicyRule(rule *tcopolicies.Rule) *TCORuleModel { + if rule == nil { + return nil + } + + ruleType := types.StringValue(tcoPoliciesRuleTypeProtoToSchema[rule.GetRuleTypeId()]) + + names := strings.Split(rule.GetName().GetValue(), ",") + namesSet := stringSliceToTypeStringSet(names) + + return &TCORuleModel{ + RuleType: ruleType, + Names: namesSet, + } +} + +func extractUpdateTCOPolicy(ctx context.Context, plan TCOPolicyResourceModel) *tcopolicies.UpdatePolicyRequest { + id := typeStringToWrapperspbString(plan.ID) + name := typeStringToWrapperspbString(plan.Name) + description := typeStringToWrapperspbString(plan.Description) + priority := tcoPoliciesPrioritySchemaToProto[plan.Priority.ValueString()] + applicationRule := expandTCOPolicyRule(ctx, plan.Applications) + subsystemRule := expandTCOPolicyRule(ctx, plan.Subsystems) + archiveRetention := expandActiveRetention(plan.ArchiveRetentionID) + + updateRequest := &tcopolicies.UpdatePolicyRequest{ + Id: id, + Name: name, + Description: description, + Priority: priority, + ApplicationRule: applicationRule, + SubsystemRule: subsystemRule, + ArchiveRetention: archiveRetention, + SourceTypeRules: expandLogsSourceTypeUpdate(plan), + } + + return updateRequest +} + +func extractCreateTcoPolicy(ctx context.Context, plan TCOPolicyResourceModel) *tcopolicies.CreatePolicyRequest { + name := typeStringToWrapperspbString(plan.Name) + description := typeStringToWrapperspbString(plan.Description) + priority := tcoPoliciesPrioritySchemaToProto[plan.Priority.ValueString()] + applicationRule := expandTCOPolicyRule(ctx, plan.Applications) + subsystemRule := expandTCOPolicyRule(ctx, plan.Subsystems) + archiveRetention := expandActiveRetention(plan.ArchiveRetentionID) + + createRequest := &tcopolicies.CreatePolicyRequest{ + Name: name, + Description: description, + Priority: priority, + ApplicationRule: applicationRule, + SubsystemRule: subsystemRule, + ArchiveRetention: archiveRetention, + SourceTypeRules: expandLogsSourceType(plan), + } + + return createRequest +} + +func expandLogsSourceType(plan TCOPolicyResourceModel) *tcopolicies.CreatePolicyRequest_LogRules { + severities := expandTCOPolicySeverities(plan.Severities.Elements()) + + return &tcopolicies.CreatePolicyRequest_LogRules{ + LogRules: &tcopolicies.LogRules{ + Severities: severities, + }, + } +} + +func expandLogsSourceTypeUpdate(plan TCOPolicyResourceModel) *tcopolicies.UpdatePolicyRequest_LogRules { + severities := expandTCOPolicySeverities(plan.Severities.Elements()) + + return &tcopolicies.UpdatePolicyRequest_LogRules{ + LogRules: &tcopolicies.LogRules{ + Severities: severities, + }, + } +} + +func expandTCOPolicyRule(ctx context.Context, rule *TCORuleModel) *tcopolicies.Rule { + if rule == nil { + return nil + } + + ruleType := tcoPoliciesRuleTypeSchemaToProto[rule.RuleType.ValueString()] + names := typeStringSliceToStringSlice(ctx, rule.Names.Elements()) + nameStr := wrapperspb.String(strings.Join(names, ",")) + + return &tcopolicies.Rule{ + RuleTypeId: ruleType, + Name: nameStr, + } +} + +func (r *TCOPolicyResource) updatePoliciesOrder(ctx context.Context, policy TCOPolicyResourceModel) error { + sourceType := tcopolicies.SourceType_SOURCE_TYPE_LOGS + getPoliciesReq := &tcopolicies.GetCompanyPoliciesRequest{ + EnabledOnly: wrapperspb.Bool(false), + SourceType: &sourceType, + } + getPoliciesReqStr, _ := jsm.MarshalToString(getPoliciesReq) + log.Printf("[INFO] Get tco-policies request: %s", getPoliciesReqStr) + + getPoliciesResp, err := r.client.GetTCOPolicies(ctx, getPoliciesReq) + if err != nil { + log.Printf("[ERROR] Received error: %#v", err) + return err + } + + getPoliciesRespStr, _ := jsm.MarshalToString(getPoliciesResp) + log.Printf("[INFO] Get tco-policies response: %#v", getPoliciesRespStr) + + policies := getPoliciesResp.GetPolicies() + policiesIDsByOrder, currentPolicyIndex := getPoliciesIDsByOrderAndCurrentPolicyIndex(policies, policy) + + desiredPolicyIndex := getPolicyDesireIndex(policy, policies) + + if currentPolicyIndex == desiredPolicyIndex { + return nil + } + + policiesIDsByOrder[currentPolicyIndex].Order, policiesIDsByOrder[desiredPolicyIndex].Order = policiesIDsByOrder[desiredPolicyIndex].Order, policiesIDsByOrder[currentPolicyIndex].Order + reorderReq := &tcopolicies.ReorderPoliciesRequest{ + Orders: policiesIDsByOrder, + SourceType: sourceType, + } + reorderReqStr, _ := jsm.MarshalToString(reorderReq) + log.Printf("[INFO] Reorder tco-policies request: %s", reorderReqStr) + + reorderResp, err := r.client.ReorderTCOPolicies(ctx, reorderReq) + if err != nil { + log.Printf("[ERROR] Received error: %#v", err) + return err + } + reorderRespStr, _ := jsm.MarshalToString(reorderResp) + log.Printf("[INFO] Reorder tco-policies response: %s", reorderRespStr) + + return nil +} + +func getPoliciesIDsByOrderAndCurrentPolicyIndex(policies []*tcopolicies.Policy, policy TCOPolicyResourceModel) ([]*tcopolicies.PolicyOrder, int) { + policiesIDsByOrder := make([]*tcopolicies.PolicyOrder, len(policies)) + policyID := policy.ID.ValueString() + currentPolicyIndex := -1 + for i, p := range policies { + id := p.GetId().GetValue() + policiesIDsByOrder[i] = &tcopolicies.PolicyOrder{ + Order: wrapperspb.Int32(int32(i + 1)), + Id: wrapperspb.String(id), + } + + if id == policyID { + currentPolicyIndex = i + } + } + return policiesIDsByOrder, currentPolicyIndex +} + +func getPolicyDesireIndex(policy TCOPolicyResourceModel, policies []*tcopolicies.Policy) int { + desiredPolicyIndex := int(policy.Order.ValueInt64() - 1) + if desiredPolicyIndex >= len(policies) { + desiredPolicyIndex = len(policies) - 1 + } + return desiredPolicyIndex +} + +func expandActiveRetention(archiveRetention types.String) *tcopolicies.ArchiveRetention { + if archiveRetention.IsNull() { + return nil + } + + return &tcopolicies.ArchiveRetention{ + Id: wrapperspb.String(archiveRetention.ValueString()), + } +} + +func expandTCOPolicySeverities(severities []attr.Value) []tcopolicies.Severity { + result := make([]tcopolicies.Severity, 0, len(severities)) + for _, severity := range severities { + val, _ := severity.ToTerraformValue(context.Background()) + var str string + val.As(&str) + log.Printf("[INFO] %s", str) + s := tcoPolicySeveritySchemaToProto[str] + result = append(result, s) + } + return result +} + +func flattenArchiveRetention(archiveRetention *tcopolicies.ArchiveRetention) types.String { + if archiveRetention == nil || archiveRetention.Id == nil { + return types.StringNull() + } + + return types.StringValue(archiveRetention.GetId().GetValue()) +} + +func flattenTCOPolicySeverities(severities []tcopolicies.Severity) types.Set { + if len(severities) == 0 { + return types.SetNull(types.StringType) + } + + elements := make([]attr.Value, 0, len(severities)) + for _, severity := range severities { + elements = append(elements, types.StringValue(tcoPolicySeverityProtoToSchema[severity])) + } + return types.SetValueMust(types.StringType, elements) +} diff --git a/coralogix/resource_coralogix_tco_policy_test.go b/coralogix/resource_coralogix_tco_policy_logs_test.go similarity index 60% rename from coralogix/resource_coralogix_tco_policy_test.go rename to coralogix/resource_coralogix_tco_policy_logs_test.go index 7ead5319..061cd44c 100644 --- a/coralogix/resource_coralogix_tco_policy_test.go +++ b/coralogix/resource_coralogix_tco_policy_logs_test.go @@ -2,71 +2,72 @@ package coralogix import ( "context" - "encoding/json" "fmt" "testing" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" + "google.golang.org/protobuf/types/known/wrapperspb" "terraform-provider-coralogix/coralogix/clientset" + tcopolicies "terraform-provider-coralogix/coralogix/clientset/grpc/tco-policies" ) -var tcoPolicyResourceName1 = "coralogix_tco_policy.test_1" -var tcoPolicyResourceName2 = "coralogix_tco_policy.test_2" -var tcoPolicyResourceName3 = "coralogix_tco_policy.test_3" +var tcoPolicyResourceName1 = "coralogix_tco_policy_logs.test_1" +var tcoPolicyResourceName2 = "coralogix_tco_policy_logs.test_2" +var tcoPolicyResourceName3 = "coralogix_tco_policy_logs.test_3" func TestAccCoralogixResourceTCOPolicyCreate(t *testing.T) { resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccTCOPolicyCheckDestroy, + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + CheckDestroy: testAccTCOPolicyCheckDestroy, Steps: []resource.TestStep{ { Config: testAccCoralogixResourceTCOPolicy(), Destroy: false, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(tcoPolicyResourceName1, "name", "Example tco_policy from terraform"), - resource.TestCheckResourceAttr(tcoPolicyResourceName1, "priority", "medium"), + resource.TestCheckResourceAttr(tcoPolicyResourceName1, "name", "Example tco_policy from terraform 1"), + resource.TestCheckResourceAttr(tcoPolicyResourceName1, "priority", "low"), resource.TestCheckResourceAttr(tcoPolicyResourceName1, "order", "1"), resource.TestCheckResourceAttr(tcoPolicyResourceName1, "severities.#", "3"), resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName1, "severities.*", "debug"), resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName1, "severities.*", "verbose"), resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName1, "severities.*", "info"), - resource.TestCheckResourceAttr(tcoPolicyResourceName1, "application_name.0.starts_with", "true"), - resource.TestCheckResourceAttr(tcoPolicyResourceName1, "application_name.0.rule", "prod"), - resource.TestCheckResourceAttr(tcoPolicyResourceName1, "subsystem_name.0.is", "true"), - resource.TestCheckResourceAttr(tcoPolicyResourceName1, "subsystem_name.0.rules.#", "2"), - resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName1, "subsystem_name.0.rules.*", "mobile"), - resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName1, "subsystem_name.0.rules.*", "web"), + resource.TestCheckResourceAttr(tcoPolicyResourceName1, "applications.rule_type", "starts_with"), + resource.TestCheckResourceAttr(tcoPolicyResourceName1, "applications.names.0", "prod"), + resource.TestCheckResourceAttr(tcoPolicyResourceName1, "subsystems.rule_type", "is"), + resource.TestCheckResourceAttr(tcoPolicyResourceName1, "subsystems.names.#", "2"), + resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName1, "subsystems.names.*", "mobile"), + resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName1, "subsystems.names.*", "web"), resource.TestCheckResourceAttr(tcoPolicyResourceName1, "archive_retention_id", "e1c980d0-c910-4c54-8326-67f3cf95645a"), resource.TestCheckResourceAttr(tcoPolicyResourceName2, "name", "Example tco_policy from terraform 2"), resource.TestCheckResourceAttr(tcoPolicyResourceName2, "priority", "medium"), resource.TestCheckResourceAttr(tcoPolicyResourceName2, "order", "2"), resource.TestCheckResourceAttr(tcoPolicyResourceName2, "severities.#", "3"), - resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName2, "severities.*", "debug"), - resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName2, "severities.*", "verbose"), - resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName2, "severities.*", "info"), - resource.TestCheckResourceAttr(tcoPolicyResourceName2, "application_name.0.starts_with", "true"), - resource.TestCheckResourceAttr(tcoPolicyResourceName2, "application_name.0.rule", "prod"), - resource.TestCheckResourceAttr(tcoPolicyResourceName2, "subsystem_name.0.is", "true"), - resource.TestCheckResourceAttr(tcoPolicyResourceName2, "subsystem_name.0.rules.#", "2"), - resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName2, "subsystem_name.0.rules.*", "mobile"), - resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName2, "subsystem_name.0.rules.*", "web"), + resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName2, "severities.*", "error"), + resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName2, "severities.*", "warning"), + resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName2, "severities.*", "critical"), + resource.TestCheckResourceAttr(tcoPolicyResourceName2, "applications.rule_type", "starts_with"), + resource.TestCheckResourceAttr(tcoPolicyResourceName2, "applications.names.0", "prod"), + resource.TestCheckResourceAttr(tcoPolicyResourceName2, "subsystems.rule_type", "is"), + resource.TestCheckResourceAttr(tcoPolicyResourceName2, "subsystems.names.#", "2"), + resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName2, "subsystems.names.*", "mobile"), + resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName2, "subsystems.names.*", "web"), resource.TestCheckResourceAttr(tcoPolicyResourceName3, "name", "Example tco_policy from terraform 3"), - resource.TestCheckResourceAttr(tcoPolicyResourceName3, "priority", "medium"), + resource.TestCheckResourceAttr(tcoPolicyResourceName3, "priority", "high"), resource.TestCheckResourceAttr(tcoPolicyResourceName3, "order", "3"), resource.TestCheckResourceAttr(tcoPolicyResourceName3, "severities.#", "3"), resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName3, "severities.*", "debug"), resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName3, "severities.*", "verbose"), resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName3, "severities.*", "info"), - resource.TestCheckResourceAttr(tcoPolicyResourceName3, "application_name.0.starts_with", "true"), - resource.TestCheckResourceAttr(tcoPolicyResourceName3, "application_name.0.rule", "prod"), - resource.TestCheckResourceAttr(tcoPolicyResourceName3, "subsystem_name.0.is", "true"), - resource.TestCheckResourceAttr(tcoPolicyResourceName3, "subsystem_name.0.rules.#", "2"), - resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName3, "subsystem_name.0.rules.*", "mobile"), - resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName3, "subsystem_name.0.rules.*", "web"), + resource.TestCheckResourceAttr(tcoPolicyResourceName3, "applications.rule_type", "starts_with"), + resource.TestCheckResourceAttr(tcoPolicyResourceName3, "applications.names.0", "prod"), + resource.TestCheckResourceAttr(tcoPolicyResourceName3, "subsystems.rule_type", "is"), + resource.TestCheckResourceAttr(tcoPolicyResourceName3, "subsystems.names.#", "2"), + resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName3, "subsystems.names.*", "mobile"), + resource.TestCheckTypeSetElemAttr(tcoPolicyResourceName3, "subsystems.names.*", "web"), ), }, }, @@ -77,14 +78,14 @@ func testAccTCOPolicyCheckDestroy(s *terraform.State) error { client := testAccProvider.Meta().(*clientset.ClientSet).TCOPolicies() ctx := context.TODO() for _, rs := range s.RootModule().Resources { - if rs.Type != "coralogix_tco_policy" { + if rs.Type != "coralogix_tco_policy_logs" { continue } - if resp, err := client.GetTCOPolicy(ctx, rs.Primary.ID); err == nil { - var m map[string]interface{} - if err = json.Unmarshal([]byte(resp), &m); err == nil { - if id, ok := m["id"]; ok && id.(string) == rs.Primary.ID { + if resp, err := client.GetTCOPolicy(ctx, &tcopolicies.GetPolicyRequest{Id: wrapperspb.String(rs.Primary.ID)}); err == nil { + id := resp.GetPolicy().GetId().GetValue() + if err == nil { + if id == rs.Primary.ID { return fmt.Errorf("tco-policy still exists: %s", id) } } @@ -96,50 +97,50 @@ func testAccTCOPolicyCheckDestroy(s *terraform.State) error { func testAccCoralogixResourceTCOPolicy() string { return fmt.Sprintf( - `resource "coralogix_tco_policy" test_1 { - name = "Example tco_policy from terraform" - order = 1 - priority = "medium" - severities = ["debug", "verbose", "info"] - application_name { - starts_with = true - rule = "prod" - } - subsystem_name { - is = true - rules = ["mobile", "web"] - } - archive_retention_id = "e1c980d0-c910-4c54-8326-67f3cf95645a" + `resource "coralogix_tco_policy_logs" test_1 { + name = "Example tco_policy from terraform 1" + priority = "low" + order = 1 + severities = ["debug", "verbose", "info"] + applications = { + rule_type = "starts_with" + names = ["prod"] + } + subsystems = { + rule_type = "is" + names = ["mobile", "web"] + } + archive_retention_id = "e1c980d0-c910-4c54-8326-67f3cf95645a" } - resource "coralogix_tco_policy" test_2 { - name = "Example tco_policy from terraform 2" - order = coralogix_tco_policy.test_1.order + 1 - priority = "medium" - severities = ["debug", "verbose", "info"] - application_name { - starts_with = true - rule = "prod" - } - subsystem_name { - is = true - rules = ["mobile", "web"] + resource "coralogix_tco_policy_logs" test_2 { + name = "Example tco_policy from terraform 2" + priority = "medium" + order = coralogix_tco_policy_logs.test_1.order + 1 + severities = ["error", "warning", "critical"] + applications = { + rule_type = "starts_with" + names = ["prod"] } + subsystems = { + rule_type = "is" + names = ["mobile", "web"] + } } - resource "coralogix_tco_policy" test_3 { + resource "coralogix_tco_policy_logs" test_3 { name = "Example tco_policy from terraform 3" - order = coralogix_tco_policy.test_2.order + 1 - priority = "medium" + order = coralogix_tco_policy_logs.test_2.order + 1 + priority = "high" severities = ["debug", "verbose", "info"] - application_name { - starts_with = true - rule = "prod" - } - subsystem_name { - is = true - rules = ["mobile", "web"] + applications = { + rule_type = "starts_with" + names = ["prod"] } + subsystems = { + rule_type = "is" + names = ["mobile", "web"] + } } `) } diff --git a/coralogix/resource_coralogix_tco_policy_override.go b/coralogix/resource_coralogix_tco_policy_override.go index 084475c5..86f59fda 100644 --- a/coralogix/resource_coralogix_tco_policy_override.go +++ b/coralogix/resource_coralogix_tco_policy_override.go @@ -16,6 +16,19 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) +var ( + tcoPolicySchemaSeverityToTcoPolicyRequestSeverity = map[string]int{ + "debug": 1, + "verbose": 2, + "info": 3, + "warning": 4, + "error": 5, + "critical": 6, + } + tcoPolicyResponseSeverityToTcoPolicySchemaSeverity = reverseMapIntToString(tcoPolicySchemaSeverityToTcoPolicyRequestSeverity) + validPolicyPriorities = []string{"high", "medium", "low", "block"} +) + type tcoPolicyOverrideRequest struct { Priority string `json:"priority"` ApplicationName *string `json:"applicationName,omitempty"` diff --git a/coralogix/utils.go b/coralogix/utils.go index da85b725..da442105 100644 --- a/coralogix/utils.go +++ b/coralogix/utils.go @@ -304,10 +304,21 @@ func wrappedStringSliceToTypeStringSlice(s []*wrapperspb.StringValue) types.Set return types.SetValueMust(types.StringType, elements) } -func typeStringSliceToWrappedStringSlice(s []attr.Value) []*wrapperspb.StringValue { +func stringSliceToTypeStringSet(s []string) types.Set { + if len(s) == 0 { + return types.SetNull(types.StringType) + } + elements := make([]attr.Value, 0, len(s)) + for _, v := range s { + elements = append(elements, types.StringValue(v)) + } + return types.SetValueMust(types.StringType, elements) +} + +func typeStringSliceToWrappedStringSlice(ctx context.Context, s []attr.Value) []*wrapperspb.StringValue { result := make([]*wrapperspb.StringValue, 0, len(s)) for _, v := range s { - val, _ := v.ToTerraformValue(context.Background()) + val, _ := v.ToTerraformValue(ctx) var str string val.As(&str) result = append(result, wrapperspb.String(str)) @@ -315,6 +326,17 @@ func typeStringSliceToWrappedStringSlice(s []attr.Value) []*wrapperspb.StringVal return result } +func typeStringSliceToStringSlice(ctx context.Context, s []attr.Value) []string { + result := make([]string, 0, len(s)) + for _, v := range s { + val, _ := v.ToTerraformValue(ctx) + var str string + val.As(&str) + result = append(result, str) + } + return result +} + func timeInDaySchema(description string) *schema.Schema { timeRegex := regexp.MustCompile(`^(0\d|1\d|2[0-3]):[0-5]\d$`) return &schema.Schema{ diff --git a/docs/data-sources/tco_policy.md b/docs/data-sources/tco_policy.md deleted file mode 100644 index 18408720..00000000 --- a/docs/data-sources/tco_policy.md +++ /dev/null @@ -1,63 +0,0 @@ ---- - -# generated by https://github.com/hashicorp/terraform-plugin-docs - -page_title: "coralogix_tco_policy Data Source - terraform-provider-coralogix" -subcategory: "" -description: "Coralogix TCO-Policy. For more information - https://coralogix.com/docs/tco-optimizer-api ." - ---- - -# coralogix_tco_policy (Data Source) - -Coralogix TCO-Policy. For more information - https://coralogix.com/docs/tco-optimizer-api . - -## Example Usage - -```hcl -data "coralogix_tco_policy" "imported_coralogix_tco_policy" { - id = coralogix_tco_policy.tco_policy_example.id -} -``` - - -## Schema - -### Read-Only - -- `application_name` (List of Object) The applications to apply the policy on. Applies the policy on all the applications by default. (see [below for nested schema](#nestedatt--application_name)) -- `archive_retention_id` (String) Allowing logs with a specific retention to be tagged -- `enabled` (Boolean) Determines weather the policy will be enabled. True by default. -- `id` (String) The ID of this resource. -- `name` (String) The policy name. Have to be unique per policy. -- `order` (Number) Determines the policy's order between the other policies. Currently, will be computed by creation order. -- `priority` (String) The policy priority. Can be one of ["high" "medium" "low" "block"]. -- `severities` (Set of String) The severities to apply the policy on. Can be few of ["warning" "error" "critical" "debug" "verbose" "info"]. -- `subsystem_name` (List of Object) The subsystems to apply the policy on. Applies the policy on all the subsystems by default. (see [below for nested schema](#nestedatt--subsystem_name)) - - -### Nested Schema for `application_name` - -Read-Only: - -- `includes` (Boolean) -- `is` (Boolean) -- `is_not` (Boolean) -- `rule` (String) -- `rules` (Set of String) -- `starts_with` (Boolean) - - - -### Nested Schema for `subsystem_name` - -Read-Only: - -- `includes` (Boolean) -- `is` (Boolean) -- `is_not` (Boolean) -- `rule` (String) -- `rules` (Set of String) -- `starts_with` (Boolean) - - diff --git a/docs/data-sources/tco_policy_logs.md b/docs/data-sources/tco_policy_logs.md new file mode 100644 index 00000000..54ed8d71 --- /dev/null +++ b/docs/data-sources/tco_policy_logs.md @@ -0,0 +1,57 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "coralogix_tco_policy_logs Data Source - terraform-provider-coralogix" +subcategory: "" +description: |- + Coralogix TCO-Policy. For more information - https://coralogix.com/docs/tco-optimizer-api . +--- + +# coralogix_tco_policy_logs (Data Source) + +Coralogix TCO-Policy. For more information - https://coralogix.com/docs/tco-optimizer-api . + +## Example Usage + +```hcl +data "coralogix_tco_policy_logs" "imported_coralogix_tco_policy" { + id = coralogix_tco_policy.tco_policy_example.id +} +``` + + +## Schema + +### Optional + +- `id` (String) tco-policy ID. + +### Read-Only + +- `applications` (Attributes) The applications to apply the policy on. Applies the policy on all the applications by default. (see [below for nested schema](#nestedatt--applications)) +- `archive_retention_id` (String) Allowing logs with a specific retention to be tagged. +- `description` (String) The policy description +- `enabled` (Boolean) Determines weather the policy will be enabled. True by default. +- `name` (String) tco-policy name. +- `order` (Number) Determines the policy's order between the other policies. +- `priority` (String) The policy priority. Can be one of ["block" "high" "low" "medium"]. +- `severities` (Set of String) The severities to apply the policy on. Can be few of ["debug" "verbose" "info" "warning" "error" "critical"]. +- `subsystems` (Attributes) The subsystems to apply the policy on. Applies the policy on all the subsystems by default. (see [below for nested schema](#nestedatt--subsystems)) + + +### Nested Schema for `applications` + +Read-Only: + +- `names` (Set of String) +- `rule_type` (String) The rule type. Can be one of ["is" "is_not" "starts_with" "includes"]. + + + +### Nested Schema for `subsystems` + +Read-Only: + +- `names` (Set of String) +- `rule_type` (String) + + diff --git a/docs/resources/tco_policy.md b/docs/resources/tco_policy.md deleted file mode 100644 index 02289348..00000000 --- a/docs/resources/tco_policy.md +++ /dev/null @@ -1,110 +0,0 @@ ---- - -# generated by https://github.com/hashicorp/terraform-plugin-docs - -page_title: "coralogix_tco_policy Resource - terraform-provider-coralogix" -subcategory: "" -description: "Coralogix TCO-Policy. For more information - https://coralogix.com/docs/tco-optimizer-api ." ---- - -# coralogix_tco_policy (Resource) - -Coralogix TCO-Policy. For more information - https://coralogix.com/docs/tco-optimizer-api . - -**Please note** - [Policies order issue](https://github.com/coralogix/terraform-provider-coralogix/issues/114) -## Example Usage - -```hcl -resource "coralogix_tco_policy" "tco_policy" { - name = "Example tco_policy from terraform" - priority = "medium" - order = 1 - severities = ["debug", "verbose", "info"] - application_name { - starts_with = true - rule = "prod" - } - subsystem_name { - is = true - rules = ["mobile", "web"] - } - archive_retention_id = "e1c980d0-c910-4c54-8326-67f3cf95645a" -} - -resource "coralogix_tco_policy" "tco_policy_2" { - name = "Example tco_policy from terraform 2" - priority = "high" - - order = 2 - severities = ["error", "warning", "critical"] - application_name { - starts_with = true - rule = "prod" - } - subsystem_name { - is = true - rules = ["mobile", "web"] - } -} -``` - - - -## Schema - -### Required - -- `name` (String) The policy name. Have to be unique per policy. -- `order` (Number) Determines the policy's order between the other policies. Currently, will be computed by creation order. -- `priority` (String) The policy priority. Can be one of ["high" "medium" "low" "block"]. -- `severities` (Set of String) The severities to apply the policy on. Can be few of ["warning" "error" "critical" "debug" "verbose" "info"]. - -### Optional - -- `application_name` (Block List, Max: 1) The applications to apply the policy on. Applies the policy on all the applications by default. (see [below for nested schema](#nestedblock--application_name)) -- `archive_retention_id` (String) Allowing logs with a specific retention to be tagged. -- `enabled` (Boolean) Determines weather the policy will be enabled. True by default. -- `subsystem_name` (Block List, Max: 1) The subsystems to apply the policy on. Applies the policy on all the subsystems by default. (see [below for nested schema](#nestedblock--subsystem_name)) -- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) - -### Read-Only - -- `id` (String) The ID of this resource. - - -### Nested Schema for `application_name` - -Optional: - -- `includes` (Boolean) Determines the filter's type. One of is/is_not/starts_with/includes have to be set. -- `is` (Boolean) Determines the filter's type. One of is/is_not/starts_with/includes have to be set. -- `is_not` (Boolean) Determines the filter's type. One of is/is_not/starts_with/includes have to be set. -- `rule` (String) Single rule to apply the filter on. In case of start_with=true/includes=true replace to 'rule' (single string). -- `rules` (Set of String) Set of rules to apply the filter on. In case of is=true/is_not=true replace to 'rules' (set of strings). -- `starts_with` (Boolean) Determines the filter's type. One of is/is_not/starts_with/includes have to be set. - - - -### Nested Schema for `subsystem_name` - -Optional: - -- `includes` (Boolean) Determines the filter's type. One of is/is_not/starts_with/includes have to be set. -- `is` (Boolean) Determines the filter's type. One of is/is_not/starts_with/includes have to be set. -- `is_not` (Boolean) Determines the filter's type. One of is/is_not/starts_with/includes have to be set. -- `rule` (String) Single rule to apply the filter on. In case of start_with=true/includes=true replace to 'rule' (single string). -- `rules` (Set of String) Set of rules to apply the filter on. In case of is=true/is_not=true replace to 'rules' (set of strings). -- `starts_with` (Boolean) Determines the filter's type. One of is/is_not/starts_with/includes have to be set. - - - -### Nested Schema for `timeouts` - -Optional: - -- `create` (String) -- `delete` (String) -- `read` (String) -- `update` (String) - - diff --git a/docs/resources/tco_policy_logs.md b/docs/resources/tco_policy_logs.md new file mode 100644 index 00000000..cd4932d7 --- /dev/null +++ b/docs/resources/tco_policy_logs.md @@ -0,0 +1,94 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "coralogix_tco_policy_logs Resource - terraform-provider-coralogix" +subcategory: "" +description: "Coralogix TCO-Policy. For more information - https://coralogix.com/docs/tco-optimizer-api ." +--- + +# coralogix_tco_policy_logs (Resource) + +Coralogix TCO-Policy. For more information - https://coralogix.com/docs/tco-optimizer-api . + +**Please note** - [Policies order issue](https://github.com/coralogix/terraform-provider-coralogix/issues/114) +## Example Usage + +```hcl +resource "coralogix_tco_policy_logs" "tco_policy_1" { + name = "Example tco_policy from terraform 1" + priority = "low" + order = 1 + severities = ["debug", "verbose", "info"] + applications = { + rule_type = "starts with" + names = ["prod"] + } + subsystems = { + rule_type = "is" + names = ["mobile", "web"] + } + archive_retention_id = "e1c980d0-c910-4c54-8326-67f3cf95645a" +} + +resource "coralogix_tco_policy_logs" "tco_policy_2" { + name = "Example tco_policy from terraform 2" + priority = "medium" + order = 2 + + severities = ["error", "warning", "critical"] + applications = { + rule_type = "starts with" + names = ["prod"] + } + subsystems = { + rule_type = "is" + names = ["mobile", "web"] + } +} +``` + + +## Schema + +### Required + +- `name` (String) tco-policy name. +- `order` (Number) Determines the policy's order between the other policies. +- `priority` (String) The policy priority. Can be one of ["block" "high" "low" "medium"]. + +### Optional + +- `applications` (Attributes) The applications to apply the policy on. Applies the policy on all the applications by default. (see [below for nested schema](#nestedatt--applications)) +- `archive_retention_id` (String) Allowing logs with a specific retention to be tagged. +- `description` (String) The policy description +- `enabled` (Boolean) Determines weather the policy will be enabled. True by default. +- `severities` (Set of String) The severities to apply the policy on. Can be few of ["debug" "verbose" "info" "warning" "error" "critical"]. +- `subsystems` (Attributes) The subsystems to apply the policy on. Applies the policy on all the subsystems by default. (see [below for nested schema](#nestedatt--subsystems)) + +### Read-Only + +- `id` (String) tco-policy ID. + + +### Nested Schema for `applications` + +Required: + +- `names` (Set of String) + +Optional: + +- `rule_type` (String) The rule type. Can be one of ["is" "is_not" "starts_with" "includes"]. + + + +### Nested Schema for `subsystems` + +Required: + +- `names` (Set of String) + +Optional: + +- `rule_type` (String) + + diff --git a/examples/tco_policy/main.tf b/examples/tco_policy/main.tf deleted file mode 100644 index 851fa086..00000000 --- a/examples/tco_policy/main.tf +++ /dev/null @@ -1,84 +0,0 @@ -terraform { - required_providers { - coralogix = { - version = "~> 1.5" - source = "coralogix/coralogix" - } - } -} - -provider "coralogix" { - #api_key = "" - #env = "" -} - -resource "coralogix_tco_policy" "tco_policy_1" { - name = "Example tco_policy from terraform 1" - priority = "low" - order = 1 - severities = ["debug", "verbose", "info"] - application_name { - starts_with = true - rule = "prod" - } - subsystem_name { - is = true - rules = ["mobile", "web"] - } - archive_retention_id = "e1c980d0-c910-4c54-8326-67f3cf95645a" -} - -resource "coralogix_tco_policy" "tco_policy_2" { - name = "Example tco_policy from terraform 2" - priority = "medium" - - order = 2 - - severities = ["error", "warning", "critical"] - application_name { - starts_with = true - rule = "prod" - } - subsystem_name { - is = true - rules = ["mobile", "web"] - } -} - -resource "coralogix_tco_policy" "tco_policy_3" { - name = "Example tco_policy from terraform 3" - priority = "high" - - order = 3 - # currently, for controlling the policies order they have to be created by the order you want them to be. - # for this purpose, defining dependency via the 'order' field can control their creation order. - - severities = ["error", "warning", "critical"] - application_name { - starts_with = true - rule = "prod" - } - subsystem_name { - is = true - rules = ["mobile", "web"] - } -} - -resource "coralogix_tco_policy" "tco_policy_4" { - name = "Example tco_policy from terraform 4" - priority = "high" - - order = 4 - # currently, for controlling the policies order they have to be created by the order you want them to be. - # for this purpose, defining dependency via the 'order' field can control their creation order. - - severities = ["error", "warning", "critical"] - application_name { - starts_with = true - rule = "prod" - } - subsystem_name { - is = true - rules = ["mobile", "web"] - } -} \ No newline at end of file diff --git a/examples/tco_policy_logs/main.tf b/examples/tco_policy_logs/main.tf new file mode 100644 index 00000000..3df4e193 --- /dev/null +++ b/examples/tco_policy_logs/main.tf @@ -0,0 +1,77 @@ +terraform { + required_providers { + coralogix = { + version = "~> 1.7" + source = "coralogix/coralogix" + } + } +} + +provider "coralogix" { + #api_key = "" + #env = "" +} + +resource "coralogix_tco_policy_logs" "tco_policy_1" { + name = "Example tco_policy from terraform 1" + priority = "low" + order = 1 + severities = ["debug", "verbose", "info"] + applications = { + rule_type = "starts_with" + names = ["prod"] + } + subsystems = { + rule_type = "is" + names = ["mobile", "web"] + } + archive_retention_id = "e1c980d0-c910-4c54-8326-67f3cf95645a" +} + +resource "coralogix_tco_policy_logs" "tco_policy_2" { + name = "Example tco_policy from terraform 2" + priority = "medium" + order = 2 + + severities = ["error", "warning", "critical"] + applications = { + rule_type = "starts_with" + names = ["prod"] + } + subsystems = { + rule_type = "is" + names = ["mobile", "web"] + } +} + +resource "coralogix_tco_policy_logs" "tco_policy_3" { + name = "Example tco_policy from terraform 3" + priority = "high" + order = 3 + + severities = ["error", "warning", "critical"] + applications = { + rule_type = "starts_with" + names = ["prod"] + } + subsystems = { + rule_type = "is" + names = ["mobile", "web"] + } +} + +resource "coralogix_tco_policy_logs" "tco_policy_4" { + name = "Example tco_policy from terraform 4" + priority = "high" + order = 4 + + severities = ["error", "warning", "critical"] + applications = { + rule_type = "starts_with" + names = ["prod"] + } + subsystems = { + rule_type = "is" + names = ["mobile", "web"] + } +}