Class Alarm
- java.lang.Object
- 
- com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
- 
- com.oracle.bmc.monitoring.model.Alarm
 
 
- 
 @Generated(value="OracleSDKGenerator", comments="API Version: 20180401") public final class Alarm extends com.oracle.bmc.http.client.internal.ExplicitlySetBmcModelThe properties that define an alarm.For information about alarms, see Alarms Overview. To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see [Getting Started with Policies](https://docs.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm). For information about endpoints and signing API requests, see [About the API](https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm). For information about available SDKs and tools, see [SDKS and Other Tools](https://docs.oracle.com/iaas/Content/API/Concepts/sdks.htm). 
 Note: Objects should always be created or deserialized using theAlarm.Builder. This model distinguishes fields that are null because they are unset from fields that are explicitly set to null. This is done in the setter methods of theAlarm.Builder, which maintain a set of all explicitly set fields calledAlarm.Builder.__explicitlySet__. ThehashCode()andequals(Object)methods are implemented to take the explicitly set fields into account. The constructor, on the other hand, does not take the explicitly set fields into account (since the constructor cannot distinguish explicit null from unset null).
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classAlarm.Builderstatic classAlarm.LifecycleStateThe current lifecycle state of the alarm.static classAlarm.MessageFormatThe format to use for alarm notifications.static classAlarm.SeverityThe perceived type of response required when the alarm is in the “FIRING” state.
 - 
Constructor SummaryConstructors Constructor Description Alarm(String id, String displayName, String compartmentId, String metricCompartmentId, Boolean metricCompartmentIdInSubtree, String namespace, String resourceGroup, String query, String resolution, String pendingDuration, Alarm.Severity severity, String body, Boolean isNotificationsPerMetricDimensionEnabled, Alarm.MessageFormat messageFormat, List<String> destinations, String repeatNotificationDuration, Suppression suppression, Boolean isEnabled, Map<String,String> freeformTags, Map<String,Map<String,Object>> definedTags, List<AlarmOverride> overrides, String ruleName, String notificationVersion, String notificationTitle, String evaluationSlackDuration, String alarmSummary, Alarm.LifecycleState lifecycleState, Date timeCreated, Date timeUpdated)Deprecated.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Alarm.Builderbuilder()Create a new builder.booleanequals(Object o)StringgetAlarmSummary()Customizable alarm summary (alarmSummary alarm message parameter).StringgetBody()The human-readable content of the delivered alarm notification.StringgetCompartmentId()The OCID of the compartment containing the alarm.Map<String,Map<String,Object>>getDefinedTags()Usage of predefined tag keys.List<String>getDestinations()A list of destinations for alarm notifications.StringgetDisplayName()A user-friendly name for the alarm.StringgetEvaluationSlackDuration()Customizable slack period to wait for metric ingestion before evaluating the alarm.Map<String,String>getFreeformTags()Simple key-value pair that is applied without any predefined name, type or scope.StringgetId()The OCID of the alarm.BooleangetIsEnabled()Whether the alarm is enabled.BooleangetIsNotificationsPerMetricDimensionEnabled()When set to true, splits alarm notifications per metric stream.Alarm.LifecycleStategetLifecycleState()The current lifecycle state of the alarm.Alarm.MessageFormatgetMessageFormat()The format to use for alarm notifications.StringgetMetricCompartmentId()The OCID of the compartment containing the metric being evaluated by the alarm.BooleangetMetricCompartmentIdInSubtree()When true, the alarm evaluates metrics from all compartments and subcompartments.StringgetNamespace()The source service or application emitting the metric that is evaluated by the alarm.StringgetNotificationTitle()Customizable notification title (title alarm message parameter).StringgetNotificationVersion()The version of the alarm notification to be delivered.List<AlarmOverride>getOverrides()A set of overrides that control evaluations of the alarm.StringgetPendingDuration()The period of time that the condition defined in the alarm must persist before the alarm state changes from “OK” to “FIRING”.StringgetQuery()The Monitoring Query Language (MQL) expression to evaluate for the alarm.StringgetRepeatNotificationDuration()The frequency for re-submitting alarm notifications, if the alarm keeps firing without interruption.StringgetResolution()The time between calculated aggregation windows for the alarm.StringgetResourceGroup()Resource group to match for metric data retrieved by the alarm.StringgetRuleName()Identifier of the alarm’s base values for alarm evaluation, for use when the alarm contains overrides.Alarm.SeveritygetSeverity()The perceived type of response required when the alarm is in the “FIRING” state.SuppressiongetSuppression()The configuration details for suppressing an alarm.DategetTimeCreated()The date and time the alarm was created.DategetTimeUpdated()The date and time the alarm was last updated.inthashCode()Alarm.BuildertoBuilder()StringtoString()StringtoString(boolean includeByteArrayContents)Return a string representation of the object.
 
- 
- 
- 
Constructor Detail- 
Alarm@Deprecated @ConstructorProperties({"id","displayName","compartmentId","metricCompartmentId","metricCompartmentIdInSubtree","namespace","resourceGroup","query","resolution","pendingDuration","severity","body","isNotificationsPerMetricDimensionEnabled","messageFormat","destinations","repeatNotificationDuration","suppression","isEnabled","freeformTags","definedTags","overrides","ruleName","notificationVersion","notificationTitle","evaluationSlackDuration","alarmSummary","lifecycleState","timeCreated","timeUpdated"}) public Alarm(String id, String displayName, String compartmentId, String metricCompartmentId, Boolean metricCompartmentIdInSubtree, String namespace, String resourceGroup, String query, String resolution, String pendingDuration, Alarm.Severity severity, String body, Boolean isNotificationsPerMetricDimensionEnabled, Alarm.MessageFormat messageFormat, List<String> destinations, String repeatNotificationDuration, Suppression suppression, Boolean isEnabled, Map<String,String> freeformTags, Map<String,Map<String,Object>> definedTags, List<AlarmOverride> overrides, String ruleName, String notificationVersion, String notificationTitle, String evaluationSlackDuration, String alarmSummary, Alarm.LifecycleState lifecycleState, Date timeCreated, Date timeUpdated) Deprecated.
 
- 
 - 
Method Detail- 
builderpublic static Alarm.Builder builder() Create a new builder.
 - 
toBuilderpublic Alarm.Builder toBuilder() 
 - 
getDisplayNamepublic String getDisplayName() A user-friendly name for the alarm.It does not have to be unique, and it’s changeable. This value determines the title of each alarm notification. Example: High CPU Utilization - Returns:
- the value
 
 - 
getCompartmentIdpublic String getCompartmentId() The OCID of the compartment containing the alarm.- Returns:
- the value
 
 - 
getMetricCompartmentIdpublic String getMetricCompartmentId() The OCID of the compartment containing the metric being evaluated by the alarm.- Returns:
- the value
 
 - 
getMetricCompartmentIdInSubtreepublic Boolean getMetricCompartmentIdInSubtree() 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 - Returns:
- the value
 
 - 
getNamespacepublic String getNamespace() The source service or application emitting the metric that is evaluated by the alarm.Example: oci_computeagent - Returns:
- the value
 
 - 
getResourceGrouppublic String getResourceGroup() Resource group to match for metric data retrieved by the alarm.A resource group is a custom string that you can match when retrieving custom metrics. 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 ($). Example: frontend-fleet - Returns:
- the value
 
 - 
getQuerypublic String getQuery() 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. Also, you can customize the absence detection period. Supported grouping functions: grouping(), groupBy(). For information about writing MQL expressions, see Editing the MQL Expression for a Query. For details about 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() ----- Example of absence alarm with custom absence detection period of 20 hours: ----- CpuUtilization[1m]{availabilityDomain="cumS:PHX-AD-1"}.absent(20h) ----- - Returns:
- the value
 
 - 
getResolutionpublic String getResolution() The time between calculated aggregation windows for the alarm.Supported value: 1m - Returns:
- the value
 
 - 
getPendingDurationpublic String getPendingDuration() 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 - Returns:
- the value
 
 - 
getSeveritypublic Alarm.Severity getSeverity() The perceived type of response required when the alarm is in the “FIRING” state.Example: CRITICAL - Returns:
- the value
 
 - 
getBodypublic String getBody() The human-readable content of the delivered alarm notification.Optionally include dynamic variables. 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. - Returns:
- the value
 
 - 
getIsNotificationsPerMetricDimensionEnabledpublic Boolean getIsNotificationsPerMetricDimensionEnabled() When set to true, splits alarm notifications per metric stream.When set to false, groups alarm notifications across metric streams. - Returns:
- the value
 
 - 
getMessageFormatpublic Alarm.MessageFormat getMessageFormat() The format to use for alarm notifications.The formats are: * RAW - Raw JSON blob. Default value. When the destinations attribute specifies Streaming, all alarm notifications use this format. * PRETTY_JSON: JSON with new lines and indents. Available when the destinations attribute specifies Notifications only. * ONS_OPTIMIZED: Simplified, user-friendly layout. Available when the destinations attribute specifies Notifications only. Applies to Email subscription types only. - Returns:
- the value
 
 - 
getDestinationspublic List<String> getDestinations() A list of destinations for alarm notifications.Each destination is represented by the OCID of a related resource, such as a NotificationTopic. Supported destination services: Notifications, Streaming. Limit: One destination per supported destination service.- Returns:
- the value
 
 - 
getRepeatNotificationDurationpublic String getRepeatNotificationDuration() The frequency for re-submitting alarm notifications, 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 - Returns:
- the value
 
 - 
getSuppressionpublic Suppression getSuppression() The configuration details for suppressing an alarm.- Returns:
- the value
 
 - 
getIsEnabledpublic Boolean getIsEnabled() Whether the alarm is enabled.Example: true - Returns:
- the value
 
 - 
getFreeformTagspublic Map<String,String> getFreeformTags() Simple key-value pair that is applied without any predefined name, type or scope.Exists for cross-compatibility only. Example: {“Department”: “Finance”} - Returns:
- the value
 
 - 
getDefinedTagspublic Map<String,Map<String,Object>> getDefinedTags() Usage of predefined tag keys.These predefined keys are scoped to namespaces. Example: {“Operations”: {“CostCenter”: “42”}} - Returns:
- the value
 
 - 
getOverridespublic List<AlarmOverride> getOverrides() A set of overrides that control evaluations of the alarm.Each override can specify values for query, severity, body, and pending duration. When an alarm contains overrides, the Monitoring service evaluates each override in order, beginning with the first override in the array (index position 0), and then evaluates the alarm's base values (ruleName value of BASE). - Returns:
- the value
 
 - 
getRuleNamepublic String getRuleName() Identifier of the alarm’s base values for alarm evaluation, for use when the alarm contains overrides.Default value is BASE. For information about alarm overrides, see alarmOverride.- Returns:
- the value
 
 - 
getNotificationVersionpublic String getNotificationVersion() The version of the alarm notification to be delivered.Allowed value: 1.X The value must start with a number (up to four digits), followed by a period and an uppercase X. - Returns:
- the value
 
 - 
getNotificationTitlepublic String getNotificationTitle() Customizable notification title (title alarm message parameter).Optionally include dynamic variables. The notification title appears as the subject line in a formatted email message and as the title in a Slack message. - Returns:
- the value
 
 - 
getEvaluationSlackDurationpublic String getEvaluationSlackDuration() Customizable slack period to wait for metric ingestion before evaluating the alarm.Specify a string in ISO 8601 format (PT10M for ten minutes or PT1H for one hour). Minimum: PT3M. Maximum: PT2H. Default: PT3M. For more information about the slack period, see About the Internal Reset Period. - Returns:
- the value
 
 - 
getAlarmSummarypublic String getAlarmSummary() Customizable alarm summary (alarmSummary alarm message parameter).Optionally include dynamic variables. The alarm summary appears within the body of the alarm message and in responses to listAlarmsStatusgetAlarmHistoryandretrieveDimensionStates.- Returns:
- the value
 
 - 
getLifecycleStatepublic Alarm.LifecycleState getLifecycleState() The current lifecycle state of the alarm.Example: DELETED - Returns:
- the value
 
 - 
getTimeCreatedpublic Date getTimeCreated() The date and time the alarm was created.Format defined by RFC3339. Example: 2023-02-01T01:02:29.600Z - Returns:
- the value
 
 - 
getTimeUpdatedpublic Date getTimeUpdated() The date and time the alarm was last updated.Format defined by RFC3339. Example: 2023-02-03T01:02:29.600Z - Returns:
- the value
 
 - 
toStringpublic String toString() - Overrides:
- toStringin class- com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
 
 - 
toStringpublic String toString(boolean includeByteArrayContents) Return a string representation of the object.- Parameters:
- includeByteArrayContents- true to include the full contents of byte arrays
- Returns:
- string representation
 
 - 
equalspublic boolean equals(Object o) - Overrides:
- equalsin class- com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
 
 
- 
 
-