public static class CreateAlarmDetails.Builder extends Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
CreateAlarmDetails.Builder |
body(String body)
The human-readable content of the notification delivered.
|
CreateAlarmDetails |
build() |
CreateAlarmDetails.Builder |
compartmentId(String compartmentId)
The OCID
of the compartment containing the alarm.
|
CreateAlarmDetails.Builder |
copy(CreateAlarmDetails model) |
CreateAlarmDetails.Builder |
definedTags(Map<String,Map<String,Object>> definedTags)
Usage of predefined tag keys.
|
CreateAlarmDetails.Builder |
destinations(List<String> destinations)
A list of destinations to which the notifications for this alarm will be delivered.
|
CreateAlarmDetails.Builder |
displayName(String displayName)
A user-friendly name for the alarm.
|
CreateAlarmDetails.Builder |
freeformTags(Map<String,String> freeformTags)
Simple key-value pair that is applied without any predefined name, type or scope.
|
CreateAlarmDetails.Builder |
isEnabled(Boolean isEnabled)
Whether the alarm is enabled.
|
CreateAlarmDetails.Builder |
isNotificationsPerMetricDimensionEnabled(Boolean isNotificationsPerMetricDimensionEnabled)
When set to
true , splits notifications per metric stream. |
CreateAlarmDetails.Builder |
messageFormat(CreateAlarmDetails.MessageFormat messageFormat)
The format to use for notification messages sent from this alarm.
|
CreateAlarmDetails.Builder |
metricCompartmentId(String metricCompartmentId)
The OCID
of the compartment containing the metric being evaluated by the alarm.
|
CreateAlarmDetails.Builder |
metricCompartmentIdInSubtree(Boolean metricCompartmentIdInSubtree)
When true, the alarm evaluates metrics from all compartments and subcompartments.
|
CreateAlarmDetails.Builder |
namespace(String namespace)
The source service or application emitting the metric that is evaluated by the alarm.
|
CreateAlarmDetails.Builder |
pendingDuration(String pendingDuration)
The period of time that the condition defined in the alarm must persist before the alarm
state changes from “OK” to “FIRING”.
|
CreateAlarmDetails.Builder |
query(String query)
The Monitoring Query Language (MQL) expression to evaluate for the alarm.
|
CreateAlarmDetails.Builder |
repeatNotificationDuration(String repeatNotificationDuration)
The frequency at which notifications are re-submitted, if the alarm keeps firing without
interruption.
|
CreateAlarmDetails.Builder |
resolution(String resolution)
The time between calculated aggregation windows for the alarm.
|
CreateAlarmDetails.Builder |
resourceGroup(String resourceGroup)
Resource group that you want to match.
|
CreateAlarmDetails.Builder |
severity(Alarm.Severity severity)
The perceived type of response required when the alarm is in the “FIRING” state.
|
CreateAlarmDetails.Builder |
suppression(Suppression suppression)
The configuration details for suppressing an alarm.
|
public CreateAlarmDetails.Builder displayName(String displayName)
A user-friendly name for the alarm. It does not have to be unique, and it’s changeable. Avoid entering confidential information.
This name is sent as the title for notifications related to this alarm.
Example: High CPU Utilization
displayName
- the value to setpublic CreateAlarmDetails.Builder compartmentId(String compartmentId)
The OCID of the compartment containing the alarm.
compartmentId
- the value to setpublic CreateAlarmDetails.Builder metricCompartmentId(String metricCompartmentId)
The OCID of the compartment containing the metric being evaluated by the alarm.
metricCompartmentId
- the value to setpublic CreateAlarmDetails.Builder metricCompartmentIdInSubtree(Boolean metricCompartmentIdInSubtree)
When true, the alarm evaluates metrics from all compartments and subcompartments. The parameter can only be set to true when metricCompartmentId is the tenancy OCID (the tenancy is the root compartment). A true value requires the user to have tenancy-level permissions. If this requirement is not met, then the call is rejected. When false, the alarm evaluates metrics from only the compartment specified in metricCompartmentId. Default is false.
Example: true
metricCompartmentIdInSubtree
- the value to setpublic CreateAlarmDetails.Builder namespace(String namespace)
The source service or application emitting the metric that is evaluated by the alarm.
Example: oci_computeagent
namespace
- the value to setpublic CreateAlarmDetails.Builder resourceGroup(String resourceGroup)
Resource group that you want to match. A null value returns only metric data that has no resource groups. The alarm retrieves metric data associated with the specified resource group only. Only one resource group can be applied per metric. A valid resourceGroup value starts with an alphabetical character and includes only alphanumeric characters, periods (.), underscores (_), hyphens (-), and dollar signs ($). Avoid entering confidential information.
Example: frontend-fleet
resourceGroup
- the value to setpublic CreateAlarmDetails.Builder query(String query)
The Monitoring Query Language (MQL) expression to evaluate for the alarm. The Alarms
feature of the Monitoring service interprets results for each returned time series as
Boolean values, where zero represents false and a non-zero value represents true. A true
value means that the trigger rule condition has been met. The query must specify a
metric, statistic, interval, and trigger rule (threshold or absence). Supported values
for interval depend on the specified time range. More interval values are supported for
smaller time ranges. You can optionally specify dimensions and grouping functions.
Supported grouping functions: grouping()
, groupBy()
. For details about
Monitoring Query Language (MQL), see Monitoring Query Language (MQL)
Reference. For
available dimensions, review the metric definition for the supported service. See
Supported
Services.
Example of threshold alarm:
-----
CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.groupBy(availabilityDomain).percentile(0.9) > 85
-----
Example of absence alarm:
-----
CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.absent()
-----
query
- the value to setpublic CreateAlarmDetails.Builder resolution(String resolution)
The time between calculated aggregation windows for the alarm. Supported value: 1m
resolution
- the value to setpublic CreateAlarmDetails.Builder pendingDuration(String pendingDuration)
The period of time that the condition defined in the alarm must persist before the alarm state changes from “OK” to “FIRING”. For example, a value of 5 minutes means that the alarm must persist in breaching the condition for five minutes before the alarm updates its state to “FIRING”.
The duration is specified as a string in ISO 8601 format (PT10M
for ten
minutes or PT1H
for one hour). Minimum: PT1M. Maximum: PT1H. Default: PT1M.
Under the default value of PT1M, the first evaluation that breaches the alarm updates the state to "FIRING".
The alarm updates its status to "OK" when the breaching condition has been clear for the most recent minute.
Example: PT5M
pendingDuration
- the value to setpublic CreateAlarmDetails.Builder severity(Alarm.Severity severity)
The perceived type of response required when the alarm is in the “FIRING” state.
Example: CRITICAL
severity
- the value to setpublic CreateAlarmDetails.Builder body(String body)
The human-readable content of the notification delivered. Oracle recommends providing guidance to operators for resolving the alarm condition. Consider adding links to standard runbook practices. Avoid entering confidential information.
Example: High CPU usage alert. Follow runbook instructions for resolution.
body
- the value to setpublic CreateAlarmDetails.Builder isNotificationsPerMetricDimensionEnabled(Boolean isNotificationsPerMetricDimensionEnabled)
When set to true
, splits notifications per metric stream. When set to false
, groups notifications across metric streams. Example: true
isNotificationsPerMetricDimensionEnabled
- the value to setpublic CreateAlarmDetails.Builder messageFormat(CreateAlarmDetails.MessageFormat messageFormat)
The format to use for notification messages sent from this alarm. The formats are: *
RAW
- Raw JSON blob. Default value. * PRETTY_JSON
: JSON with new lines
and indents. * ONS_OPTIMIZED
: Simplified, user-friendly layout. Applies only to
messages sent through the Notifications service to the following subscription types:
Email.
messageFormat
- the value to setpublic CreateAlarmDetails.Builder destinations(List<String> destinations)
A list of destinations to which the notifications for this alarm will be delivered. Each destination is represented by an OCID related to the supported destination service. For example, a destination using the Notifications service is represented by a topic OCID. Supported destination services: Notifications Service. Limit: One destination per supported destination service.
destinations
- the value to setpublic CreateAlarmDetails.Builder repeatNotificationDuration(String repeatNotificationDuration)
The frequency at which notifications are re-submitted, if the alarm keeps firing without
interruption. Format defined by ISO 8601. For example, PT4H
indicates four hours.
Minimum: PT1M. Maximum: P30D.
Default value: null (notifications are not re-submitted).
Example: PT2H
repeatNotificationDuration
- the value to setpublic CreateAlarmDetails.Builder suppression(Suppression suppression)
The configuration details for suppressing an alarm.
suppression
- the value to setpublic CreateAlarmDetails.Builder isEnabled(Boolean isEnabled)
Whether the alarm is enabled.
Example: true
isEnabled
- the value to setpublic CreateAlarmDetails.Builder freeformTags(Map<String,String> freeformTags)
Simple key-value pair that is applied without any predefined name, type or scope. Exists
for cross-compatibility only. Example: {"Department": "Finance"}
freeformTags
- the value to setpublic CreateAlarmDetails.Builder definedTags(Map<String,Map<String,Object>> definedTags)
Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example:
{"Operations": {"CostCenter": "42"}}
definedTags
- the value to setpublic CreateAlarmDetails build()
public CreateAlarmDetails.Builder copy(CreateAlarmDetails model)
Copyright © 2016–2023. All rights reserved.