
com.pulumi.signalfx.outputs.DetectorRule Maven / Gradle / Ivy
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.signalfx.outputs;
import com.pulumi.core.annotations.CustomType;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
@CustomType
public final class DetectorRule {
/**
* @return Description for the rule. Displays as the alert condition in the Alert Rules tab of the detector editor in the web UI.
*
*/
private @Nullable String description;
/**
* @return A detect label which matches a detect label within `program_text`.
*
*/
private String detectLabel;
/**
* @return When true, notifications and events will not be generated for the detect label. `false` by default.
*
*/
private @Nullable Boolean disabled;
/**
* @return List of strings specifying where notifications will be sent when an incident occurs. See [Create A Single Detector](https://dev.splunk.com/observability/reference/api/detectors/latest) for more info.
*
*/
private @Nullable List notifications;
/**
* @return Custom notification message body when an alert is triggered. See [Set Up Detectors to Trigger Alerts](https://docs.splunk.com/observability/en/alerts-detectors-notifications/create-detectors-for-alerts.html) for more info.
*
*/
private @Nullable String parameterizedBody;
/**
* @return Custom notification message subject when an alert is triggered. See [Set Up Detectors to Trigger Alerts](https://docs.splunk.com/observability/en/alerts-detectors-notifications/create-detectors-for-alerts.html) for more info.
*
*/
private @Nullable String parameterizedSubject;
/**
* @return URL of page to consult when an alert is triggered. This can be used with custom notification messages.
*
*/
private @Nullable String runbookUrl;
/**
* @return The severity of the rule, must be one of: `"Critical"`, `"Major"`, `"Minor"`, `"Warning"`, `"Info"`.
*
*/
private String severity;
/**
* @return Plain text suggested first course of action, such as a command line to execute. This can be used with custom notification messages.
*
*/
private @Nullable String tip;
private DetectorRule() {}
/**
* @return Description for the rule. Displays as the alert condition in the Alert Rules tab of the detector editor in the web UI.
*
*/
public Optional description() {
return Optional.ofNullable(this.description);
}
/**
* @return A detect label which matches a detect label within `program_text`.
*
*/
public String detectLabel() {
return this.detectLabel;
}
/**
* @return When true, notifications and events will not be generated for the detect label. `false` by default.
*
*/
public Optional disabled() {
return Optional.ofNullable(this.disabled);
}
/**
* @return List of strings specifying where notifications will be sent when an incident occurs. See [Create A Single Detector](https://dev.splunk.com/observability/reference/api/detectors/latest) for more info.
*
*/
public List notifications() {
return this.notifications == null ? List.of() : this.notifications;
}
/**
* @return Custom notification message body when an alert is triggered. See [Set Up Detectors to Trigger Alerts](https://docs.splunk.com/observability/en/alerts-detectors-notifications/create-detectors-for-alerts.html) for more info.
*
*/
public Optional parameterizedBody() {
return Optional.ofNullable(this.parameterizedBody);
}
/**
* @return Custom notification message subject when an alert is triggered. See [Set Up Detectors to Trigger Alerts](https://docs.splunk.com/observability/en/alerts-detectors-notifications/create-detectors-for-alerts.html) for more info.
*
*/
public Optional parameterizedSubject() {
return Optional.ofNullable(this.parameterizedSubject);
}
/**
* @return URL of page to consult when an alert is triggered. This can be used with custom notification messages.
*
*/
public Optional runbookUrl() {
return Optional.ofNullable(this.runbookUrl);
}
/**
* @return The severity of the rule, must be one of: `"Critical"`, `"Major"`, `"Minor"`, `"Warning"`, `"Info"`.
*
*/
public String severity() {
return this.severity;
}
/**
* @return Plain text suggested first course of action, such as a command line to execute. This can be used with custom notification messages.
*
*/
public Optional tip() {
return Optional.ofNullable(this.tip);
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(DetectorRule defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private @Nullable String description;
private String detectLabel;
private @Nullable Boolean disabled;
private @Nullable List notifications;
private @Nullable String parameterizedBody;
private @Nullable String parameterizedSubject;
private @Nullable String runbookUrl;
private String severity;
private @Nullable String tip;
public Builder() {}
public Builder(DetectorRule defaults) {
Objects.requireNonNull(defaults);
this.description = defaults.description;
this.detectLabel = defaults.detectLabel;
this.disabled = defaults.disabled;
this.notifications = defaults.notifications;
this.parameterizedBody = defaults.parameterizedBody;
this.parameterizedSubject = defaults.parameterizedSubject;
this.runbookUrl = defaults.runbookUrl;
this.severity = defaults.severity;
this.tip = defaults.tip;
}
@CustomType.Setter
public Builder description(@Nullable String description) {
this.description = description;
return this;
}
@CustomType.Setter
public Builder detectLabel(String detectLabel) {
if (detectLabel == null) {
throw new MissingRequiredPropertyException("DetectorRule", "detectLabel");
}
this.detectLabel = detectLabel;
return this;
}
@CustomType.Setter
public Builder disabled(@Nullable Boolean disabled) {
this.disabled = disabled;
return this;
}
@CustomType.Setter
public Builder notifications(@Nullable List notifications) {
this.notifications = notifications;
return this;
}
public Builder notifications(String... notifications) {
return notifications(List.of(notifications));
}
@CustomType.Setter
public Builder parameterizedBody(@Nullable String parameterizedBody) {
this.parameterizedBody = parameterizedBody;
return this;
}
@CustomType.Setter
public Builder parameterizedSubject(@Nullable String parameterizedSubject) {
this.parameterizedSubject = parameterizedSubject;
return this;
}
@CustomType.Setter
public Builder runbookUrl(@Nullable String runbookUrl) {
this.runbookUrl = runbookUrl;
return this;
}
@CustomType.Setter
public Builder severity(String severity) {
if (severity == null) {
throw new MissingRequiredPropertyException("DetectorRule", "severity");
}
this.severity = severity;
return this;
}
@CustomType.Setter
public Builder tip(@Nullable String tip) {
this.tip = tip;
return this;
}
public DetectorRule build() {
final var _resultValue = new DetectorRule();
_resultValue.description = description;
_resultValue.detectLabel = detectLabel;
_resultValue.disabled = disabled;
_resultValue.notifications = notifications;
_resultValue.parameterizedBody = parameterizedBody;
_resultValue.parameterizedSubject = parameterizedSubject;
_resultValue.runbookUrl = runbookUrl;
_resultValue.severity = severity;
_resultValue.tip = tip;
return _resultValue;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy