Skip to content

Commit 6459cad

Browse files
authored
ENG-28667: Added splunk webhook support (#162)
* added splunk webhook support * resolved comment
1 parent cc27573 commit 6459cad

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

notification-channel-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_channel.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ message NotificationChannelMutableData {
1414
repeated EmailChannelConfig email_channel_config = 2;
1515
repeated WebhookChannelConfig webhook_channel_config = 3;
1616
repeated AwsS3BucketChannelConfig s3_bucket_channel_config = 4;
17+
repeated SplunkIntegrationChannelConfig splunk_integration_channel_config = 5;
1718
}
1819

1920
message AwsS3BucketChannelConfig {
@@ -50,3 +51,7 @@ message WebhookHeader {
5051
string value = 2; // omitted on response if isSecret is true
5152
bool is_secret = 3;
5253
}
54+
55+
message SplunkIntegrationChannelConfig {
56+
string splunk_integration_id = 1;
57+
}

notification-channel-config-service-impl/src/main/java/org/hypertrace/notification/config/service/NotificationChannelConfigServiceRequestValidator.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.hypertrace.notification.config.service.v1.GetAllNotificationChannelsRequest;
1414
import org.hypertrace.notification.config.service.v1.GetNotificationChannelRequest;
1515
import org.hypertrace.notification.config.service.v1.NotificationChannelMutableData;
16+
import org.hypertrace.notification.config.service.v1.SplunkIntegrationChannelConfig;
1617
import org.hypertrace.notification.config.service.v1.UpdateNotificationChannelRequest;
1718
import org.hypertrace.notification.config.service.v1.WebhookChannelConfig;
1819
import org.hypertrace.notification.config.service.v1.WebhookHeader;
@@ -37,12 +38,15 @@ private void validateNotificationChannelMutableData(NotificationChannelMutableDa
3738
data, NotificationChannelMutableData.CHANNEL_NAME_FIELD_NUMBER);
3839
if (data.getEmailChannelConfigCount() == 0
3940
&& data.getWebhookChannelConfigCount() == 0
40-
&& data.getS3BucketChannelConfigCount() == 0) {
41+
&& data.getS3BucketChannelConfigCount() == 0
42+
&& data.getSplunkIntegrationChannelConfigCount() == 0) {
4143
throw Status.INVALID_ARGUMENT.withDescription("No config present").asRuntimeException();
4244
}
4345
data.getEmailChannelConfigList().forEach(this::validateEmailChannelConfig);
4446
data.getWebhookChannelConfigList().forEach(this::validateWebhookChannelConfig);
4547
data.getS3BucketChannelConfigList().forEach(this::validateS3BucketConfig);
48+
data.getSplunkIntegrationChannelConfigList()
49+
.forEach(this::validateSplunkIntegrationChannelConfig);
4650
}
4751

4852
public void validateGetAllNotificationChannelsRequest(
@@ -96,4 +100,11 @@ private void validateS3BucketConfig(AwsS3BucketChannelConfig awsS3BucketChannelC
96100
private void validateWebhookHeader(WebhookHeader webhookHeader) {
97101
validateNonDefaultPresenceOrThrow(webhookHeader, WebhookHeader.NAME_FIELD_NUMBER);
98102
}
103+
104+
private void validateSplunkIntegrationChannelConfig(
105+
SplunkIntegrationChannelConfig splunkIntegrationChannelConfig) {
106+
validateNonDefaultPresenceOrThrow(
107+
splunkIntegrationChannelConfig,
108+
SplunkIntegrationChannelConfig.SPLUNK_INTEGRATION_ID_FIELD_NUMBER);
109+
}
99110
}

0 commit comments

Comments
 (0)