CreateAlarmDetails¶
- class oci.monitoring.models.CreateAlarmDetails(**kwargs)¶
Bases:
objectThe configuration details for creating an alarm.
Attributes:
A constant which can be used with the message_format property of a CreateAlarmDetails.
A constant which can be used with the message_format property of a CreateAlarmDetails.
A constant which can be used with the message_format property of a CreateAlarmDetails.
Gets the alarm_summary of this CreateAlarmDetails.
Gets the body of this CreateAlarmDetails.
[Required] Gets the compartment_id of this CreateAlarmDetails.
Gets the defined_tags of this CreateAlarmDetails.
[Required] Gets the destinations of this CreateAlarmDetails.
[Required] Gets the display_name of this CreateAlarmDetails.
Gets the evaluation_slack_duration of this CreateAlarmDetails.
Gets the freeform_tags of this CreateAlarmDetails.
[Required] Gets the is_enabled of this CreateAlarmDetails.
Gets the is_notifications_per_metric_dimension_enabled of this CreateAlarmDetails.
Gets the message_format of this CreateAlarmDetails.
[Required] Gets the metric_compartment_id of this CreateAlarmDetails.
Gets the metric_compartment_id_in_subtree of this CreateAlarmDetails.
[Required] Gets the namespace of this CreateAlarmDetails.
Gets the notification_title of this CreateAlarmDetails.
Gets the notification_version of this CreateAlarmDetails.
Gets the overrides of this CreateAlarmDetails.
Gets the pending_duration of this CreateAlarmDetails.
[Required] Gets the query of this CreateAlarmDetails.
Gets the repeat_notification_duration of this CreateAlarmDetails.
Gets the resolution of this CreateAlarmDetails.
Gets the resource_group of this CreateAlarmDetails.
Gets the rule_name of this CreateAlarmDetails.
[Required] Gets the severity of this CreateAlarmDetails.
Gets the suppression of this CreateAlarmDetails.
Methods:
__init__(**kwargs)Initializes a new CreateAlarmDetails object with values from keyword arguments.
- MESSAGE_FORMAT_ONS_OPTIMIZED = 'ONS_OPTIMIZED'¶
A constant which can be used with the message_format property of a CreateAlarmDetails. This constant has a value of “ONS_OPTIMIZED”
- MESSAGE_FORMAT_PRETTY_JSON = 'PRETTY_JSON'¶
A constant which can be used with the message_format property of a CreateAlarmDetails. This constant has a value of “PRETTY_JSON”
- MESSAGE_FORMAT_RAW = 'RAW'¶
A constant which can be used with the message_format property of a CreateAlarmDetails. This constant has a value of “RAW”
- __init__(**kwargs)¶
Initializes a new CreateAlarmDetails object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):
- Parameters
display_name (str) – The value to assign to the display_name property of this CreateAlarmDetails.
compartment_id (str) – The value to assign to the compartment_id property of this CreateAlarmDetails.
metric_compartment_id (str) – The value to assign to the metric_compartment_id property of this CreateAlarmDetails.
metric_compartment_id_in_subtree (bool) – The value to assign to the metric_compartment_id_in_subtree property of this CreateAlarmDetails.
namespace (str) – The value to assign to the namespace property of this CreateAlarmDetails.
resource_group (str) – The value to assign to the resource_group property of this CreateAlarmDetails.
query (str) – The value to assign to the query property of this CreateAlarmDetails.
resolution (str) – The value to assign to the resolution property of this CreateAlarmDetails.
pending_duration (str) – The value to assign to the pending_duration property of this CreateAlarmDetails.
severity (str) – The value to assign to the severity property of this CreateAlarmDetails.
body (str) – The value to assign to the body property of this CreateAlarmDetails.
is_notifications_per_metric_dimension_enabled (bool) – The value to assign to the is_notifications_per_metric_dimension_enabled property of this CreateAlarmDetails.
message_format (str) – The value to assign to the message_format property of this CreateAlarmDetails. Allowed values for this property are: “RAW”, “PRETTY_JSON”, “ONS_OPTIMIZED”
destinations (list[str]) – The value to assign to the destinations property of this CreateAlarmDetails.
repeat_notification_duration (str) – The value to assign to the repeat_notification_duration property of this CreateAlarmDetails.
suppression (oci.monitoring.models.Suppression) – The value to assign to the suppression property of this CreateAlarmDetails.
is_enabled (bool) – The value to assign to the is_enabled property of this CreateAlarmDetails.
freeform_tags (dict(str, str)) – The value to assign to the freeform_tags property of this CreateAlarmDetails.
defined_tags (dict(str, dict(str, object))) – The value to assign to the defined_tags property of this CreateAlarmDetails.
overrides (list[oci.monitoring.models.AlarmOverride]) – The value to assign to the overrides property of this CreateAlarmDetails.
rule_name (str) – The value to assign to the rule_name property of this CreateAlarmDetails.
notification_version (str) – The value to assign to the notification_version property of this CreateAlarmDetails.
notification_title (str) – The value to assign to the notification_title property of this CreateAlarmDetails.
evaluation_slack_duration (str) – The value to assign to the evaluation_slack_duration property of this CreateAlarmDetails.
alarm_summary (str) – The value to assign to the alarm_summary property of this CreateAlarmDetails.
- property alarm_summary¶
Gets the alarm_summary of this CreateAlarmDetails. 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
list_alarms_status()get_alarm_history()andretrieve_dimension_states().- Returns
The alarm_summary of this CreateAlarmDetails.
- Return type
str
- property body¶
Gets the body of this CreateAlarmDetails. 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 body of this CreateAlarmDetails.
- Return type
str
- property compartment_id¶
[Required] Gets the compartment_id of this CreateAlarmDetails. The OCID of the compartment containing the alarm.
- Returns
The compartment_id of this CreateAlarmDetails.
- Return type
str
- property defined_tags¶
Gets the defined_tags of this CreateAlarmDetails. Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: {“Operations”: {“CostCenter”: “42”}}
- Returns
The defined_tags of this CreateAlarmDetails.
- Return type
dict(str, dict(str, object))
- property destinations¶
[Required] Gets the destinations of this CreateAlarmDetails. 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 destinations of this CreateAlarmDetails.
- Return type
list[str]
- property display_name¶
[Required] Gets the display_name of this CreateAlarmDetails. A user-friendly name for the alarm. It does not have to be unique, and it’s changeable. Avoid entering confidential information.
This value determines the title of each alarm notification.
Example: High CPU Utilization
- Returns
The display_name of this CreateAlarmDetails.
- Return type
str
- property evaluation_slack_duration¶
Gets the evaluation_slack_duration of this CreateAlarmDetails. 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 evaluation_slack_duration of this CreateAlarmDetails.
- Return type
str
- property freeform_tags¶
Gets the freeform_tags of this CreateAlarmDetails. Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {“Department”: “Finance”}
- Returns
The freeform_tags of this CreateAlarmDetails.
- Return type
dict(str, str)
- property is_enabled¶
[Required] Gets the is_enabled of this CreateAlarmDetails. Whether the alarm is enabled.
Example: true
- Returns
The is_enabled of this CreateAlarmDetails.
- Return type
bool
- property is_notifications_per_metric_dimension_enabled¶
Gets the is_notifications_per_metric_dimension_enabled of this CreateAlarmDetails. When set to true, splits alarm notifications per metric stream. When set to false, groups alarm notifications across metric streams. Example: true
- Returns
The is_notifications_per_metric_dimension_enabled of this CreateAlarmDetails.
- Return type
bool
- property message_format¶
Gets the message_format of this CreateAlarmDetails. 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.
Allowed values for this property are: “RAW”, “PRETTY_JSON”, “ONS_OPTIMIZED”
- Returns
The message_format of this CreateAlarmDetails.
- Return type
str
- property metric_compartment_id¶
[Required] Gets the metric_compartment_id of this CreateAlarmDetails. The OCID of the compartment containing the metric being evaluated by the alarm.
- Returns
The metric_compartment_id of this CreateAlarmDetails.
- Return type
str
- property metric_compartment_id_in_subtree¶
Gets the metric_compartment_id_in_subtree of this CreateAlarmDetails. 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 metric_compartment_id_in_subtree of this CreateAlarmDetails.
- Return type
bool
- property namespace¶
[Required] Gets the namespace of this CreateAlarmDetails. The source service or application emitting the metric that is evaluated by the alarm.
Example: oci_computeagent
- Returns
The namespace of this CreateAlarmDetails.
- Return type
str
- property notification_title¶
Gets the notification_title of this CreateAlarmDetails. 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 notification_title of this CreateAlarmDetails.
- Return type
str
- property notification_version¶
Gets the notification_version of this CreateAlarmDetails. 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 notification_version of this CreateAlarmDetails.
- Return type
str
- property overrides¶
Gets the overrides of this CreateAlarmDetails. 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 overrides of this CreateAlarmDetails.
- Return type
- property pending_duration¶
Gets the pending_duration of this CreateAlarmDetails. 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 pending_duration of this CreateAlarmDetails.
- Return type
str
- property query¶
[Required] Gets the query of this CreateAlarmDetails. 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 query of this CreateAlarmDetails.
- Return type
str
- property repeat_notification_duration¶
Gets the repeat_notification_duration of this CreateAlarmDetails. 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 repeat_notification_duration of this CreateAlarmDetails.
- Return type
str
- property resolution¶
Gets the resolution of this CreateAlarmDetails. The time between calculated aggregation windows for the alarm. Supported value: 1m
- Returns
The resolution of this CreateAlarmDetails.
- Return type
str
- property resource_group¶
Gets the resource_group of this CreateAlarmDetails. 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
- Returns
The resource_group of this CreateAlarmDetails.
- Return type
str
- property rule_name¶
Gets the rule_name of this CreateAlarmDetails. 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
alarm_override().- Returns
The rule_name of this CreateAlarmDetails.
- Return type
str
- property severity¶
[Required] Gets the severity of this CreateAlarmDetails. The perceived type of response required when the alarm is in the “FIRING” state.
Example: CRITICAL
- Returns
The severity of this CreateAlarmDetails.
- Return type
str
- property suppression¶
Gets the suppression of this CreateAlarmDetails. The configuration details for suppressing an alarm.
- Returns
The suppression of this CreateAlarmDetails.
- Return type