Skip to content

Commit

Permalink
Rules group to use Coralogix-Management-SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
assafad1 committed Sep 26, 2024
1 parent b8f0604 commit b833f13
Show file tree
Hide file tree
Showing 14 changed files with 215 additions and 4,447 deletions.
161 changes: 80 additions & 81 deletions apis/coralogix/v1alpha1/rulegroup_types.go

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions controllers/alphacontrollers/rulegroup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"context"
"fmt"

cxsdk "github.com/coralogix/coralogix-management-sdk/go"
"github.com/coralogix/coralogix-operator/controllers/clientset"
rulesgroups "github.com/coralogix/coralogix-operator/controllers/clientset/grpc/rules-groups/v1"

"github.com/golang/protobuf/jsonpb"
"google.golang.org/grpc/codes"
Expand Down Expand Up @@ -102,9 +102,9 @@ func (r *RuleGroupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
}

ruleGroupId := *ruleGroupCRD.Status.ID
deleteRuleGroupReq := &rulesgroups.DeleteRuleGroupRequest{GroupId: ruleGroupId}
deleteRuleGroupReq := &cxsdk.DeleteRuleGroupRequest{GroupId: ruleGroupId}
log.V(1).Info("Deleting Rule-Group", "Rule-Group ID", ruleGroupId)
if _, err := rulesGroupsClient.DeleteRuleGroup(ctx, deleteRuleGroupReq); err != nil {
if _, err := rulesGroupsClient.Delete(ctx, deleteRuleGroupReq); err != nil {
// if fail to delete the external dependency here, return with error
// so that it can be retried unless it is deleted manually.
log.Error(err, "Received an error while Deleting a Rule-Group", "Rule-Group ID", ruleGroupId)
Expand Down Expand Up @@ -138,7 +138,7 @@ func (r *RuleGroupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
log.V(1).Info("ruleGroup wasn't created")
notFound = true
} else {
getRuleGroupResp, err := rulesGroupsClient.GetRuleGroup(ctx, &rulesgroups.GetRuleGroupRequest{GroupId: *id})
getRuleGroupResp, err := rulesGroupsClient.Get(ctx, &cxsdk.GetRuleGroupRequest{GroupId: *id})
switch {
case status.Code(err) == codes.NotFound:
log.V(1).Info("ruleGroup doesn't exist in Coralogix backend")
Expand All @@ -159,7 +159,7 @@ func (r *RuleGroupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
createRuleGroupReq := ruleGroupCRD.Spec.ExtractCreateRuleGroupRequest()
jstr, _ := jsm.MarshalToString(createRuleGroupReq)
log.V(1).Info("Creating Rule-Group", "ruleGroup", jstr)
if createRuleGroupResp, err := rulesGroupsClient.CreateRuleGroup(ctx, createRuleGroupReq); err == nil {
if createRuleGroupResp, err := rulesGroupsClient.Create(ctx, createRuleGroupReq); err == nil {
jstr, _ := jsm.MarshalToString(createRuleGroupResp)
log.V(1).Info("Rule-Group was updated", "ruleGroup", jstr)

Expand Down Expand Up @@ -193,7 +193,7 @@ func (r *RuleGroupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
if equal, diff := ruleGroupCRD.Spec.DeepEqual(*actualState); !equal {
log.V(1).Info("Find diffs between spec and the actual state", "Diff", diff)
updateRuleGroupReq := ruleGroupCRD.Spec.ExtractUpdateRuleGroupRequest(*ruleGroupCRD.Status.ID)
updateRuleGroupResp, err := rulesGroupsClient.UpdateRuleGroup(ctx, updateRuleGroupReq)
updateRuleGroupResp, err := rulesGroupsClient.Update(ctx, updateRuleGroupReq)
if err != nil {
log.Error(err, "Received an error while updating a Rule-Group", "ruleGroup", updateRuleGroupReq)
return ctrl.Result{RequeueAfter: defaultErrRequeuePeriod}, err
Expand All @@ -205,7 +205,7 @@ func (r *RuleGroupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
return ctrl.Result{}, nil
}

func flattenRuleGroup(ruleGroup *rulesgroups.RuleGroup) (*coralogixv1alpha1.RuleGroupStatus, error) {
func flattenRuleGroup(ruleGroup *cxsdk.RuleGroup) (*coralogixv1alpha1.RuleGroupStatus, error) {
var status coralogixv1alpha1.RuleGroupStatus

status.ID = new(string)
Expand Down Expand Up @@ -238,7 +238,7 @@ func flattenRuleGroup(ruleGroup *rulesgroups.RuleGroup) (*coralogixv1alpha1.Rule
return &status, nil
}

func flattenRuleSubGroups(subgroups []*rulesgroups.RuleSubgroup) ([]coralogixv1alpha1.RuleSubGroup, error) {
func flattenRuleSubGroups(subgroups []*cxsdk.RuleSubgroup) ([]coralogixv1alpha1.RuleSubGroup, error) {
result := make([]coralogixv1alpha1.RuleSubGroup, 0, len(subgroups))
for _, sg := range subgroups {
subgroup, err := flattenRuleSubGroup(sg)
Expand All @@ -250,7 +250,7 @@ func flattenRuleSubGroups(subgroups []*rulesgroups.RuleSubgroup) ([]coralogixv1a
return result, nil
}

func flattenRuleSubGroup(subGroup *rulesgroups.RuleSubgroup) (coralogixv1alpha1.RuleSubGroup, error) {
func flattenRuleSubGroup(subGroup *cxsdk.RuleSubgroup) (coralogixv1alpha1.RuleSubGroup, error) {
var result coralogixv1alpha1.RuleSubGroup

result.ID = new(string)
Expand All @@ -269,7 +269,7 @@ func flattenRuleSubGroup(subGroup *rulesgroups.RuleSubgroup) (coralogixv1alpha1.
return result, nil
}

func flattenRules(rules []*rulesgroups.Rule) ([]coralogixv1alpha1.Rule, error) {
func flattenRules(rules []*cxsdk.Rule) ([]coralogixv1alpha1.Rule, error) {
result := make([]coralogixv1alpha1.Rule, 0, len(rules))
for _, r := range rules {
rule, err := flattenRule(r)
Expand All @@ -281,76 +281,76 @@ func flattenRules(rules []*rulesgroups.Rule) ([]coralogixv1alpha1.Rule, error) {
return result, nil
}

func flattenRule(rule *rulesgroups.Rule) (coralogixv1alpha1.Rule, error) {
func flattenRule(rule *cxsdk.Rule) (coralogixv1alpha1.Rule, error) {
var result coralogixv1alpha1.Rule
result.Name = rule.GetName().GetValue()
result.Active = rule.GetEnabled().GetValue()
result.Description = rule.GetDescription().GetValue()

switch ruleParams := rule.GetParameters().GetRuleParameters().(type) {
case *rulesgroups.RuleParameters_ExtractParameters:
case *cxsdk.RuleParameters_ExtractParameters:
extractParameters := ruleParams.ExtractParameters
result.Extract = &coralogixv1alpha1.Extract{
Regex: extractParameters.GetRule().GetValue(),
SourceField: rule.GetSourceField().GetValue(),
}
case *rulesgroups.RuleParameters_JsonExtractParameters:
case *cxsdk.RuleParameters_JsonExtractParameters:
jsonExtractParameters := ruleParams.JsonExtractParameters
result.JsonExtract = &coralogixv1alpha1.JsonExtract{
JsonKey: jsonExtractParameters.GetRule().GetValue(),
DestinationField: coralogixv1alpha1.RulesProtoSeverityDestinationFieldToSchemaDestinationField[jsonExtractParameters.GetDestinationField()],
}
case *rulesgroups.RuleParameters_ReplaceParameters:
case *cxsdk.RuleParameters_ReplaceParameters:
replaceParameters := ruleParams.ReplaceParameters
result.Replace = &coralogixv1alpha1.Replace{
SourceField: rule.GetSourceField().GetValue(),
DestinationField: replaceParameters.GetDestinationField().GetValue(),
Regex: replaceParameters.GetRule().GetValue(),
ReplacementString: replaceParameters.GetReplaceNewVal().GetValue(),
}
case *rulesgroups.RuleParameters_ParseParameters:
case *cxsdk.RuleParameters_ParseParameters:
parseParameters := ruleParams.ParseParameters
result.Parse = &coralogixv1alpha1.Parse{
SourceField: rule.GetSourceField().GetValue(),
DestinationField: parseParameters.GetDestinationField().GetValue(),
Regex: parseParameters.GetRule().GetValue(),
}
case *rulesgroups.RuleParameters_AllowParameters:
case *cxsdk.RuleParameters_AllowParameters:
allowParameters := ruleParams.AllowParameters
result.Block = &coralogixv1alpha1.Block{
SourceField: rule.GetSourceField().GetValue(),
Regex: allowParameters.GetRule().GetValue(),
KeepBlockedLogs: allowParameters.GetKeepBlockedLogs().GetValue(),
BlockingAllMatchingBlocks: false,
}
case *rulesgroups.RuleParameters_BlockParameters:
case *cxsdk.RuleParameters_BlockParameters:
blockParameters := ruleParams.BlockParameters
result.Block = &coralogixv1alpha1.Block{
SourceField: rule.GetSourceField().GetValue(),
Regex: blockParameters.GetRule().GetValue(),
KeepBlockedLogs: blockParameters.GetKeepBlockedLogs().GetValue(),
BlockingAllMatchingBlocks: true,
}
case *rulesgroups.RuleParameters_ExtractTimestampParameters:
case *cxsdk.RuleParameters_ExtractTimestampParameters:
extractTimestampParameters := ruleParams.ExtractTimestampParameters
result.ExtractTimestamp = &coralogixv1alpha1.ExtractTimestamp{
SourceField: rule.GetSourceField().GetValue(),
TimeFormat: extractTimestampParameters.GetFormat().GetValue(),
FieldFormatStandard: coralogixv1alpha1.RulesProtoFormatStandardToSchemaFormatStandard[extractTimestampParameters.GetStandard()],
}
case *rulesgroups.RuleParameters_RemoveFieldsParameters:
case *cxsdk.RuleParameters_RemoveFieldsParameters:
removeFieldsParameters := ruleParams.RemoveFieldsParameters
result.RemoveFields = &coralogixv1alpha1.RemoveFields{
ExcludedFields: removeFieldsParameters.GetFields(),
}
case *rulesgroups.RuleParameters_JsonStringifyParameters:
case *cxsdk.RuleParameters_JsonStringifyParameters:
jsonStringifyParameters := ruleParams.JsonStringifyParameters
result.JsonStringify = &coralogixv1alpha1.JsonStringify{
SourceField: rule.GetSourceField().GetValue(),
DestinationField: jsonStringifyParameters.GetDestinationField().GetValue(),
KeepSourceField: !(jsonStringifyParameters.GetDeleteSource().GetValue()),
}
case *rulesgroups.RuleParameters_JsonParseParameters:
case *cxsdk.RuleParameters_JsonParseParameters:
jsonParseParameters := ruleParams.JsonParseParameters
result.ParseJsonField = &coralogixv1alpha1.ParseJsonField{
SourceField: rule.GetSourceField().GetValue(),
Expand All @@ -364,14 +364,14 @@ func flattenRule(rule *rulesgroups.Rule) (coralogixv1alpha1.Rule, error) {
return result, nil
}

func flattenRuleMatcher(ruleMatchers []*rulesgroups.RuleMatcher) (applications, subsystems []string, severities []coralogixv1alpha1.RuleSeverity, err error) {
func flattenRuleMatcher(ruleMatchers []*cxsdk.RuleMatcher) (applications, subsystems []string, severities []coralogixv1alpha1.RuleSeverity, err error) {
for _, ruleMatcher := range ruleMatchers {
switch matcher := ruleMatcher.Constraint.(type) {
case *rulesgroups.RuleMatcher_ApplicationName:
case *cxsdk.RuleMatcher_ApplicationName:
applications = append(applications, matcher.ApplicationName.GetValue().GetValue())
case *rulesgroups.RuleMatcher_SubsystemName:
case *cxsdk.RuleMatcher_SubsystemName:
subsystems = append(subsystems, matcher.SubsystemName.GetValue().GetValue())
case *rulesgroups.RuleMatcher_Severity:
case *cxsdk.RuleMatcher_Severity:
severity := matcher.Severity.GetValue()
severities = append(severities, coralogixv1alpha1.RulesProtoSeverityToSchemaSeverity[severity])
default:
Expand Down
62 changes: 31 additions & 31 deletions controllers/alphacontrollers/rulegroup_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"fmt"
"testing"

cxsdk "github.com/coralogix/coralogix-management-sdk/go"
coralogixv1alpha1 "github.com/coralogix/coralogix-operator/apis/coralogix/v1alpha1"
"github.com/coralogix/coralogix-operator/controllers/clientset"
rulesgroups "github.com/coralogix/coralogix-operator/controllers/clientset/grpc/rules-groups/v1"
"github.com/coralogix/coralogix-operator/controllers/mock_clientset"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"
Expand All @@ -24,28 +24,28 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)

var ruleGroupBackendSchema = &rulesgroups.RuleGroup{
var ruleGroupBackendSchema = &cxsdk.RuleGroup{
Id: wrapperspb.String("id"),
Name: wrapperspb.String("name"),
Description: wrapperspb.String("description"),
Creator: wrapperspb.String("creator"),
Enabled: wrapperspb.Bool(true),
Hidden: wrapperspb.Bool(false),
RuleMatchers: []*rulesgroups.RuleMatcher{},
RuleSubgroups: []*rulesgroups.RuleSubgroup{
RuleMatchers: []*cxsdk.RuleMatcher{},
RuleSubgroups: []*cxsdk.RuleSubgroup{
{
Id: wrapperspb.String("subgroup_id"),
Order: wrapperspb.UInt32(1),
Rules: []*rulesgroups.Rule{
Rules: []*cxsdk.Rule{
{
Id: wrapperspb.String("rule_id"),
Name: wrapperspb.String("rule_name"),
Description: wrapperspb.String("rule_description"),
SourceField: wrapperspb.String("text"),
Parameters: &rulesgroups.RuleParameters{
RuleParameters: &rulesgroups.RuleParameters_JsonExtractParameters{
JsonExtractParameters: &rulesgroups.JsonExtractParameters{
DestinationField: rulesgroups.JsonExtractParameters_DESTINATION_FIELD_SEVERITY,
Parameters: &cxsdk.RuleParameters{
RuleParameters: &cxsdk.RuleParameters_JsonExtractParameters{
JsonExtractParameters: &cxsdk.JsonExtractParameters{
DestinationField: cxsdk.JsonExtractParameters_DESTINATION_FIELD_SEVERITY,
Rule: wrapperspb.String(`{"severity": "info"}`),
},
},
Expand Down Expand Up @@ -91,23 +91,23 @@ func expectedRuleGroupCRD() *coralogixv1alpha1.RuleGroup {
}

func TestFlattenRuleGroupsErrorsOnBadResponse(t *testing.T) {
ruleGroup := &rulesgroups.RuleGroup{
ruleGroup := &cxsdk.RuleGroup{
Id: wrapperspb.String("id"),
Name: wrapperspb.String("name"),
Description: wrapperspb.String("description"),
Creator: wrapperspb.String("creator"),
Enabled: wrapperspb.Bool(true),
Hidden: wrapperspb.Bool(false),
RuleMatchers: []*rulesgroups.RuleMatcher{},
RuleSubgroups: []*rulesgroups.RuleSubgroup{
RuleMatchers: []*cxsdk.RuleMatcher{},
RuleSubgroups: []*cxsdk.RuleSubgroup{
{
Rules: []*rulesgroups.Rule{
Rules: []*cxsdk.Rule{
{
Id: wrapperspb.String("rule_id"),
Name: wrapperspb.String("rule_name"),
Description: wrapperspb.String("rule_description"),
SourceField: wrapperspb.String("text"),
Parameters: &rulesgroups.RuleParameters{
Parameters: &cxsdk.RuleParameters{
RuleParameters: nil,
},
Enabled: wrapperspb.Bool(true),
Expand Down Expand Up @@ -212,8 +212,8 @@ func TestRuleGroupReconciler_Reconcile(t *testing.T) {
if !assert.NotNil(t, id) {
return
}
getRuleGroupRequest := &rulesgroups.GetRuleGroupRequest{GroupId: *id}
actualRuleGroup, err := r.CoralogixClientSet.RuleGroups().GetRuleGroup(ctx, getRuleGroupRequest)
getRuleGroupRequest := &cxsdk.GetRuleGroupRequest{GroupId: *id}
actualRuleGroup, err := r.CoralogixClientSet.RuleGroups().Get(ctx, getRuleGroupRequest)
assert.NoError(t, err)
assert.EqualValues(t, ruleGroupBackendSchema, actualRuleGroup.GetRuleGroup())

Expand All @@ -224,7 +224,7 @@ func TestRuleGroupReconciler_Reconcile(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, false, result.Requeue)

actualRuleGroup, err = r.CoralogixClientSet.RuleGroups().GetRuleGroup(ctx, getRuleGroupRequest)
actualRuleGroup, err = r.CoralogixClientSet.RuleGroups().Get(ctx, getRuleGroupRequest)
assert.Nil(t, actualRuleGroup)
assert.Error(t, err)
}
Expand Down Expand Up @@ -279,8 +279,8 @@ func TestRuleGroupReconciler_Reconcile_5XX_StatusError(t *testing.T) {
if !assert.NotNil(t, id) {
return
}
getRuleGroupRequest := &rulesgroups.GetRuleGroupRequest{GroupId: *id}
actualRuleGroup, err := r.CoralogixClientSet.RuleGroups().GetRuleGroup(ctx, getRuleGroupRequest)
getRuleGroupRequest := &cxsdk.GetRuleGroupRequest{GroupId: *id}
actualRuleGroup, err := r.CoralogixClientSet.RuleGroups().Get(ctx, getRuleGroupRequest)
assert.NoError(t, err)
assert.EqualValues(t, ruleGroupBackendSchema, actualRuleGroup.GetRuleGroup())

Expand All @@ -296,24 +296,24 @@ func createRuleGroupClientSimpleMock(mockCtrl *gomock.Controller) clientset.Rule
var ruleGroupExist bool

mockRuleGroupsClient.EXPECT().
CreateRuleGroup(gomock.Any(), gomock.Any()).DoAndReturn(func(_ context.Context, _ *rulesgroups.CreateRuleGroupRequest) (*rulesgroups.CreateRuleGroupResponse, error) {
Create(gomock.Any(), gomock.Any()).DoAndReturn(func(_ context.Context, _ *cxsdk.CreateRuleGroupRequest) (*cxsdk.CreateRuleGroupResponse, error) {
ruleGroupExist = true
return &rulesgroups.CreateRuleGroupResponse{RuleGroup: ruleGroupBackendSchema}, nil
return &cxsdk.CreateRuleGroupResponse{RuleGroup: ruleGroupBackendSchema}, nil
}).AnyTimes()

mockRuleGroupsClient.EXPECT().
GetRuleGroup(gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, req *rulesgroups.GetRuleGroupRequest) (*rulesgroups.GetRuleGroupResponse, error) {
Get(gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, req *cxsdk.GetRuleGroupRequest) (*cxsdk.GetRuleGroupResponse, error) {
if ruleGroupExist {
return &rulesgroups.GetRuleGroupResponse{RuleGroup: ruleGroupBackendSchema}, nil
return &cxsdk.GetRuleGroupResponse{RuleGroup: ruleGroupBackendSchema}, nil
}
return nil, errors.NewNotFound(schema.GroupResource{}, "id1")
}).AnyTimes()

mockRuleGroupsClient.EXPECT().
DeleteRuleGroup(gomock.Any(), gomock.Any()).DoAndReturn(func(_ context.Context, req *rulesgroups.DeleteRuleGroupRequest) (*rulesgroups.DeleteRuleGroupResponse, error) {
Delete(gomock.Any(), gomock.Any()).DoAndReturn(func(_ context.Context, req *cxsdk.DeleteRuleGroupRequest) (*cxsdk.DeleteRuleGroupResponse, error) {
if ruleGroupExist {
ruleGroupExist = false
return &rulesgroups.DeleteRuleGroupResponse{}, nil
return &cxsdk.DeleteRuleGroupResponse{}, nil
}
return nil, errors.NewNotFound(schema.GroupResource{}, "id1")
}).AnyTimes()
Expand All @@ -328,28 +328,28 @@ func createRecordingRuleGroupClientSimpleMockWith5XXStatusError(mockCtrl *gomock
var ruleGroupExist, wasCalled bool

mockRuleGroupsClient.EXPECT().
CreateRuleGroup(gomock.Any(), gomock.Any()).DoAndReturn(func(_ context.Context, _ *rulesgroups.CreateRuleGroupRequest) (*rulesgroups.CreateRuleGroupResponse, error) {
Create(gomock.Any(), gomock.Any()).DoAndReturn(func(_ context.Context, _ *cxsdk.CreateRuleGroupRequest) (*cxsdk.CreateRuleGroupResponse, error) {
if !wasCalled {
wasCalled = true
return nil, errors.NewInternalError(fmt.Errorf("internal error"))
}
ruleGroupExist = true
return &rulesgroups.CreateRuleGroupResponse{RuleGroup: ruleGroupBackendSchema}, nil
return &cxsdk.CreateRuleGroupResponse{RuleGroup: ruleGroupBackendSchema}, nil
}).AnyTimes()

mockRuleGroupsClient.EXPECT().
GetRuleGroup(gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, req *rulesgroups.GetRuleGroupRequest) (*rulesgroups.GetRuleGroupResponse, error) {
Get(gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, req *cxsdk.GetRuleGroupRequest) (*cxsdk.GetRuleGroupResponse, error) {
if ruleGroupExist {
return &rulesgroups.GetRuleGroupResponse{RuleGroup: ruleGroupBackendSchema}, nil
return &cxsdk.GetRuleGroupResponse{RuleGroup: ruleGroupBackendSchema}, nil
}
return nil, errors.NewNotFound(schema.GroupResource{}, "id1")
}).AnyTimes()

mockRuleGroupsClient.EXPECT().
DeleteRuleGroup(gomock.Any(), gomock.Any()).DoAndReturn(func(_ context.Context, req *rulesgroups.DeleteRuleGroupRequest) (*rulesgroups.DeleteRuleGroupResponse, error) {
Delete(gomock.Any(), gomock.Any()).DoAndReturn(func(_ context.Context, req *cxsdk.DeleteRuleGroupRequest) (*cxsdk.DeleteRuleGroupResponse, error) {
if ruleGroupExist {
ruleGroupExist = false
return &rulesgroups.DeleteRuleGroupResponse{}, nil
return &cxsdk.DeleteRuleGroupResponse{}, nil
}
return nil, errors.NewNotFound(schema.GroupResource{}, "id1")
}).AnyTimes()
Expand Down
7 changes: 5 additions & 2 deletions controllers/clientset/clientset.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package clientset

import cxsdk "github.com/coralogix/coralogix-management-sdk/go"

//go:generate mockgen -destination=../mock_clientset/mock_clientset.go -package=mock_clientset github.com/coralogix/coralogix-operator/controllers/clientset ClientSetInterface
type ClientSetInterface interface {
RuleGroups() RuleGroupsClientInterface
Expand All @@ -9,7 +11,7 @@ type ClientSetInterface interface {
}

type ClientSet struct {
ruleGroups *RuleGroupsClient
ruleGroups *cxsdk.RuleGroupsClient
alerts *AlertsClient
recordingRuleGroups *RecordingRulesGroupsClient
outboundWebhooks *OutboundWebhooksClient
Expand All @@ -33,9 +35,10 @@ func (c *ClientSet) OutboundWebhooks() OutboundWebhooksClientInterface {

func NewClientSet(targetUrl, apiKey string) ClientSetInterface {
apikeyCPC := NewCallPropertiesCreator(targetUrl, apiKey)
SDKAPIKeyCPC := cxsdk.NewCallPropertiesCreator(targetUrl, cxsdk.NewAuthContext(apiKey, apiKey))

return &ClientSet{
ruleGroups: NewRuleGroupsClient(apikeyCPC),
ruleGroups: cxsdk.NewRuleGroupsClient(SDKAPIKeyCPC),
alerts: NewAlertsClient(apikeyCPC),
recordingRuleGroups: NewRecordingRuleGroupsClient(apikeyCPC),
outboundWebhooks: NewOutboundWebhooksClient(apikeyCPC),
Expand Down
Loading

0 comments on commit b833f13

Please sign in to comment.