Skip to content

Commit

Permalink
Notification center re-exports
Browse files Browse the repository at this point in the history
  • Loading branch information
assafad1 committed Dec 22, 2024
1 parent f7579a6 commit 282d61a
Show file tree
Hide file tree
Showing 533 changed files with 5,076 additions and 3,548 deletions.
13 changes: 10 additions & 3 deletions go/cxsdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ type ClientSet struct {
groups *GroupsClient
saml *SamlClient
dataUsage *DataUsageClient
notifications *NotificationsClient
}

// RuleGroups gets a RuleGroupsClient from the ClientSet.
Expand Down Expand Up @@ -215,6 +216,11 @@ func (c *ClientSet) DataUsage() *DataUsageClient {
return c.dataUsage
}

// Notifications gets a NotificationsClient from the ClientSet.
func (c *ClientSet) Notifications() *NotificationsClient {
return c.notifications
}

// NewClientSet Creates a new ClientSet.
func NewClientSet(targetURL, teamsLevelAPIKey string, userLevelAPIKey string) *ClientSet {
authContext := NewAuthContext(teamsLevelAPIKey, userLevelAPIKey)
Expand All @@ -239,9 +245,10 @@ func NewClientSet(targetURL, teamsLevelAPIKey string, userLevelAPIKey string) *C
slos: NewSLOsClient(apikeyCPC),
scopes: NewScopesClient(apikeyCPC),
// dahboardsFolders: NewDashboardsFoldersClient(apikeyCPC),
apiKeys: NewAPIKeysClient(apikeyCPC),
groups: NewGroupsClient(apikeyCPC),
saml: NewSamlClient(apikeyCPC),
apiKeys: NewAPIKeysClient(apikeyCPC),
groups: NewGroupsClient(apikeyCPC),
saml: NewSamlClient(apikeyCPC),
notifications: NewNotificationsClient(apikeyCPC),
// users: NewUsersClient(apikeyCPC),
}
}
Expand Down
18 changes: 10 additions & 8 deletions go/examples/notifications_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

func TestConnectors(t *testing.T) {
t.Skip("Connectors are not supported in the current version of the SDK")
//t.Skip("Connectors are not supported in the current version of the SDK")
region, err := cxsdk.CoralogixRegionFromEnv()
assert.Nil(t, err)
authContext, err := cxsdk.AuthContextFromEnv()
Expand All @@ -36,7 +36,6 @@ func TestConnectors(t *testing.T) {
Type: cxsdk.ConnectorTypeGenericHTTPS,
Name: "TestConnector",
Description: "This is the connector to use for Notification Center testing.",
EntityType: "alerts",
ConnectorConfigs: []*cxsdk.ConnectorConfig{
{
OutputSchemaId: "default",
Expand Down Expand Up @@ -74,7 +73,7 @@ func TestConnectors(t *testing.T) {
}

func TestPresets(t *testing.T) {
t.Skip("Presets are not supported in the current version of the SDK")
//t.Skip("Presets are not supported in the current version of the SDK")
region, err := cxsdk.CoralogixRegionFromEnv()
assert.Nil(t, err)
authContext, err := cxsdk.AuthContextFromEnv()
Expand All @@ -83,15 +82,15 @@ func TestPresets(t *testing.T) {

c := cxsdk.NewNotificationsClient(creator)
presetType := cxsdk.PresetTypeCustom
parentId := "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
parentUserFacingId := "preset_system_generic_https_alerts_empty"
createRes, err := c.CreateCustomPreset(context.Background(), &cxsdk.CreateCustomPresetRequest{
Preset: &cxsdk.Preset{
Name: "TestPreset",
Description: "This is the preset to use for Notification Center testing.",
PresetType: &presetType,
EntityType: "alerts",
Parent: &cxsdk.Preset{
Id: &parentId,
UserFacingId: &parentUserFacingId,
},
ConnectorType: cxsdk.ConnectorTypeGenericHTTPS,
ConfigOverrides: []*cxsdk.ConfigOverrides{
Expand Down Expand Up @@ -126,16 +125,19 @@ func TestPresets(t *testing.T) {

presetId := createRes.Preset.Id
preset, err := c.GetPreset(context.Background(), &cxsdk.GetPresetRequest{
Id: *presetId,
})
Identifier: &cxsdk.GetPresetIDIdentifier{
Id: *presetId,
}})
if err != nil {
t.Fatal(err)
}

assert.Equal(t, preset.Preset.Name, "TestPreset")

_, err = c.DeleteCustomPreset(context.Background(), &cxsdk.DeleteCustomPresetRequest{
Id: *presetId,
Identifier: &cxsdk.DeletePresetIDIdentifier{
Id: *presetId,
},
})

if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion go/internal/coralogix/archive/dataset/v1/dataset.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 282d61a

Please sign in to comment.