alarms
Creates, updates, deletes, gets or lists an alarms resource.
Overview​
| Name | alarms |
| Type | Resource |
| Id | oci.monitoring.alarms |
Fields​
The following fields are returned by SELECT queries:
- get
- list
Successfully retrieved alarm.
| Name | Datatype | Description |
|---|---|---|
id | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the alarm. |
alarmSummary | string | Customizable alarm summary (alarmSummary [alarm message parameter](/iaas/Content/Monitoring/alarm-message-format.htm)). Optionally include [dynamic variables](/iaas/Content/Monitoring/Tasks/update-alarm-dynamic-variables.htm). The alarm summary appears within the body of the alarm message and in responses to [ListAlarmStatus](#/en/monitoring/latest/AlarmStatusSummary/ListAlarmsStatus) [GetAlarmHistory](#/en/monitoring/latest/AlarmHistoryCollection/GetAlarmHistory) and [RetrieveDimensionStates](#/en/monitoring/latest/AlarmDimensionStatesCollection/RetrieveDimensionStates). |
body | string | The human-readable content of the delivered alarm notification. Optionally include [dynamic variables](/iaas/Content/Monitoring/Tasks/update-alarm-dynamic-variables.htm). 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. |
compartmentId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the alarm. |
definedTags | object | Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: {"Operations": {"CostCenter": "42"}} |
destinations | array | A list of destinations for alarm notifications. Each destination is represented by the [OCID](/iaas/Content/General/Concepts/identifiers.htm) of a related resource, such as a [topic](#/en/notification/latest/NotificationTopic). Supported destination services: Notifications, Streaming. Limit: One destination per supported destination service. |
displayName | string | 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 |
evaluationSlackDuration | string | 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](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#reset). |
freeformTags | object | Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"Department": "Finance"} |
isEnabled | boolean | Whether the alarm is enabled. Example: true |
isNotificationsPerMetricDimensionEnabled | boolean | When set to true, splits alarm notifications per metric stream. When set to false, groups alarm notifications across metric streams. |
lifecycleState | string | The current lifecycle state of the alarm. Example: DELETED (ACTIVE, DELETING, DELETED) |
messageFormat | string | 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. (RAW, PRETTY_JSON, ONS_OPTIMIZED) (default: RAW) |
metricCompartmentId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the metric being evaluated by the alarm. |
metricCompartmentIdInSubtree | boolean | 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 |
namespace | string | The source service or application emitting the metric that is evaluated by the alarm. Example: oci_computeagent |
notificationTitle | string | Customizable notification title (title [alarm message parameter](/iaas/Content/Monitoring/alarm-message-format.htm)). Optionally include [dynamic variables](/iaas/Content/Monitoring/Tasks/update-alarm-dynamic-variables.htm). The notification title appears as the subject line in a formatted email message and as the title in a Slack message. |
notificationVersion | string | 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. |
overrides | array | 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). |
pendingDuration | string | 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: PT24H. 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 |
query | string | 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](/iaas/Content/Monitoring/Tasks/create-edit-alarm-query-absence-detection-period.htm). Supported grouping functions: grouping(), groupBy(). For information about writing MQL expressions, see [Editing the MQL Expression for a Query](/iaas/Content/Monitoring/Tasks/query-metric-mql.htm). For details about MQL, see [Monitoring Query Language (MQL) Reference](/iaas/Content/Monitoring/Reference/mql.htm). For available dimensions, review the metric definition for the supported service. See [Supported Services](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices). 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) ----- |
repeatNotificationDuration | string | 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. As another example, PT0M indicates a repeat notification each time the alarm trigger condition is met, otherwise known as an event-based notification. For more information, see [Getting Event-Based Notifications for an Alarm](/iaas/Content/Monitoring/Tasks/update-alarm-event.htm). Minimum: PT0M. Maximum: P30D. |
resolution | string | The time between calculated aggregation windows for the alarm. Supported value: 1m |
resourceGroup | string | 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 |
ruleName | string | 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](#/en/monitoring/latest/datatypes/AlarmOverride). |
severity | string | The perceived type of response required when the alarm is in the "FIRING" state. Example: CRITICAL (CRITICAL, ERROR, WARNING, INFO) |
suppression | object | The configuration details for an alarm-wide suppression. For dimension-specific suppressions, see [AlarmSuppression](#/en/monitoring/latest/AlarmSuppression). For information about alarms, see [Alarms Overview](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#AlarmsOverview). (x-example: {<br /> "description": "Planned outage due to change IT-1234.",<br /> "timeSuppressFrom": "2023-02-01T01:02:29.600Z",<br /> "timeSuppressUntil": "2023-02-01T02:02:29.600Z"<br />}<br />) |
timeCreated | string (date-time) | The date and time the alarm was created. Format defined by RFC3339. Example: 2023-02-01T01:02:29.600Z |
timeUpdated | string (date-time) | The date and time the alarm was last updated. Format defined by RFC3339. Example: 2023-02-03T01:02:29.600Z |
A summary of properties for the specified alarm.<br />For information about alarms, see<br />[Alarms Overview](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#AlarmsOverview).<br /><br />To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized,<br />talk to an administrator. If you're an administrator who needs to write policies to give users access, see<br />[Getting Started with Policies](/iaas/Content/Identity/Concepts/policygetstarted.htm).<br /><br />For information about endpoints and signing API requests, see<br />[About the API](/iaas/Content/API/Concepts/usingapi.htm).<br />For information about available SDKs and tools, see<br />[SDKS and Other Tools](/iaas/Content/API/Concepts/sdks.htm).<br />
| Name | Datatype | Description |
|---|---|---|
id | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the alarm. |
alarmSummary | string | Customizable alarm summary (alarmSummary [alarm message parameter](/iaas/Content/Monitoring/alarm-message-format.htm)). Optionally include [dynamic variables](/iaas/Content/Monitoring/Tasks/update-alarm-dynamic-variables.htm). The alarm summary appears within the body of the alarm message and in responses to [ListAlarmStatus](#/en/monitoring/latest/AlarmStatusSummary/ListAlarmsStatus) [GetAlarmHistory](#/en/monitoring/latest/AlarmHistoryCollection/GetAlarmHistory) and [RetrieveDimensionStates](#/en/monitoring/latest/AlarmDimensionStatesCollection/RetrieveDimensionStates). |
compartmentId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the alarm. |
definedTags | object | Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: {"Operations": {"CostCenter": "42"}} |
destinations | array | A list of destinations for alarm notifications. Each destination is represented by the [OCID](/iaas/Content/General/Concepts/identifiers.htm) of a related resource, such as a [topic](#/en/notification/latest/NotificationTopic). Supported destination services: Notifications, Streaming. Limit: One destination per supported destination service. |
displayName | string | 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 |
evaluationSlackDuration | string | 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](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#reset). |
freeformTags | object | Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"Department": "Finance"} |
isEnabled | boolean | Whether the alarm is enabled. Example: true |
isNotificationsPerMetricDimensionEnabled | boolean | Whether the alarm sends a separate message for each metric stream. See [Creating an Alarm That Splits Messages by Metric Stream](/iaas/Content/Monitoring/Tasks/create-alarm-split.htm). Example: true |
lifecycleState | string | The current lifecycle state of the alarm. (x-obmcs-enumref: #/definitions/Alarm/lifecycleState) |
metricCompartmentId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the metric being evaluated by the alarm. |
namespace | string | The source service or application emitting the metric that is evaluated by the alarm. Example: oci_computeagent |
notificationTitle | string | Customizable notification title (title [alarm message parameter](/iaas/Content/Monitoring/alarm-message-format.htm)). Optionally include [dynamic variables](/iaas/Content/Monitoring/Tasks/update-alarm-dynamic-variables.htm). The notification title appears as the subject line in a formatted email message and as the title in a Slack message. |
notificationVersion | string | 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. |
overrides | array | 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). |
query | string | 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. Supported grouping functions: grouping(), groupBy(). For information about writing MQL expressions, see [Editing the MQL Expression for a Query](/iaas/Content/Monitoring/Tasks/query-metric-mql.htm). For details about MQL, see [Monitoring Query Language (MQL) Reference](/iaas/Content/Monitoring/Reference/mql.htm). For available dimensions, review the metric definition for the supported service. See [Supported Services](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices). 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() ----- |
resourceGroup | string | Resource group that you want to match. A null value returns only metric data that has no resource groups. The specified resource group must exist in the definition of the posted metric. 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 |
ruleName | string | 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](#/en/monitoring/latest/datatypes/AlarmOverride). |
severity | string | The perceived type of response required when the alarm is in the "FIRING" state. Example: CRITICAL (CRITICAL, ERROR, WARNING, INFO) |
suppression | object | The configuration details for an alarm-wide suppression. For dimension-specific suppressions, see [AlarmSuppression](#/en/monitoring/latest/AlarmSuppression). For information about alarms, see [Alarms Overview](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#AlarmsOverview). (x-example: {<br /> "description": "Planned outage due to change IT-1234.",<br /> "timeSuppressFrom": "2023-02-01T01:02:29.600Z",<br /> "timeSuppressUntil": "2023-02-01T02:02:29.600Z"<br />}<br />) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | alarmId, region | opc-request-id | Gets the specified alarm.<br />For more information, see<br />[Getting an Alarm](/iaas/Content/Monitoring/Tasks/get-alarm.htm).<br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br /> |
list | select | compartmentId, region | opc-request-id, page, limit, displayName, lifecycleState, sortBy, sortOrder, compartmentIdInSubtree | Lists the alarms for the specified compartment.<br />For more information, see<br />[Listing Alarms](/iaas/Content/Monitoring/Tasks/list-alarm.htm).<br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br /> |
create | insert | region, displayName, compartmentId, metricCompartmentId, namespace, query, severity, destinations, isEnabled | opc-request-id, opc-retry-token | Creates a new alarm in the specified compartment.<br />For more information, see<br />[Creating an Alarm](/iaas/Content/Monitoring/Tasks/create-alarm.htm).<br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br /> |
update | update | alarmId, region | if-match, opc-request-id | Updates the specified alarm.<br />For more information, see<br />[Updating an Alarm](/iaas/Content/Monitoring/Tasks/update-alarm.htm).<br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br /> |
delete | delete | alarmId, region | if-match, opc-request-id | Deletes the specified alarm.<br />For more information, see<br />[Deleting an Alarm](/iaas/Content/Monitoring/Tasks/delete-alarm.htm).<br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br /> |
change_compartment | exec | alarmId, region, compartmentId | if-match, opc-request-id, opc-retry-token | Moves an alarm into a different compartment within the same tenancy.<br />For more information, see<br />[Moving an Alarm](/iaas/Content/Monitoring/Tasks/change-compartment-alarm.htm).<br /> |
remove_alarm_suppression | exec | alarmId, region | if-match, opc-request-id | Removes any existing suppression for the specified alarm.<br />For more information, see<br />[Removing a Suppression from a Single Alarm](/iaas/Content/Monitoring/Tasks/delete-alarm-suppression.htm) and<br />[Removing a Suppression from Multiple Alarms](/iaas/Content/Monitoring/Tasks/delete-alarm-suppression-multiple.htm).<br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br /> |
retrieve_dimension_states | exec | alarmId, region | opc-request-id, page, limit | Lists the current alarm status of each metric stream, where status is derived from the metric stream's last associated transition.<br />Optionally filter by status value and one or more dimension key-value pairs.<br /><br />For more information, see<br />[Listing Metric Stream Status in an Alarm](/iaas/Content/Monitoring/Tasks/list-alarm-status-metric-stream.htm).<br /><br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br /> |
summarize_alarm_suppression_history | exec | alarmId, region | opc-request-id, page, limit | Returns history of suppressions for the specified alarm, including both dimension-specific and and alarm-wide suppressions. For more information, see<br />[Getting Suppression History for an Alarm](/iaas/Content/Monitoring/Tasks/summarize-alarm-suppression-history.htm).<br /><br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br /> |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
alarmId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of an alarm. |
compartmentId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the resources monitored by the metric that you are searching for. Use tenancyId to search in the root compartment. Example: ocid1.compartment.oc1..exampleuniqueID |
region | string | OCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION) |
compartmentIdInSubtree | boolean | When true, returns resources from all compartments and subcompartments. The parameter can only be set to true when compartmentId 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, returns resources from only the compartment specified in compartmentId. Default is false. |
displayName | string | A filter to return only resources that match the given display name exactly. Use this filter to list an alarm by name. Alternatively, when you know the alarm OCID, use the GetAlarm operation. |
if-match | string | For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value. |
lifecycleState | string | A filter to return only alarms that match the given lifecycle state exactly. When not specified, only alarms in the ACTIVE lifecycle state are listed. |
limit | integer | For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine). Default: 1000 Example: 500 |
opc-request-id | string | Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID. |
opc-retry-token | string | A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected. |
page | string | For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine). |
sortBy | string | The field to use when sorting returned alarm definitions. Only one sorting level is provided. Example: severity |
sortOrder | string | The sort order to use when sorting returned alarm definitions. Ascending (ASC) or descending (DESC). Example: ASC |
SELECT examples​
- get
- list
Gets the specified alarm.<br />For more information, see<br />[Getting an Alarm](/iaas/Content/Monitoring/Tasks/get-alarm.htm).<br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br />
SELECT
id,
alarmSummary,
body,
compartmentId,
definedTags,
destinations,
displayName,
evaluationSlackDuration,
freeformTags,
isEnabled,
isNotificationsPerMetricDimensionEnabled,
lifecycleState,
messageFormat,
metricCompartmentId,
metricCompartmentIdInSubtree,
namespace,
notificationTitle,
notificationVersion,
overrides,
pendingDuration,
query,
repeatNotificationDuration,
resolution,
resourceGroup,
ruleName,
severity,
suppression,
timeCreated,
timeUpdated
FROM oci.monitoring.alarms
WHERE alarmId = '{{ alarmId }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
;
Lists the alarms for the specified compartment.<br />For more information, see<br />[Listing Alarms](/iaas/Content/Monitoring/Tasks/list-alarm.htm).<br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br />
SELECT
id,
alarmSummary,
compartmentId,
definedTags,
destinations,
displayName,
evaluationSlackDuration,
freeformTags,
isEnabled,
isNotificationsPerMetricDimensionEnabled,
lifecycleState,
metricCompartmentId,
namespace,
notificationTitle,
notificationVersion,
overrides,
query,
resourceGroup,
ruleName,
severity,
suppression
FROM oci.monitoring.alarms
WHERE compartmentId = '{{ compartmentId }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
AND page = '{{ page }}'
AND limit = '{{ limit }}'
AND displayName = '{{ displayName }}'
AND lifecycleState = '{{ lifecycleState }}'
AND sortBy = '{{ sortBy }}'
AND sortOrder = '{{ sortOrder }}'
AND compartmentIdInSubtree = '{{ compartmentIdInSubtree }}'
;
INSERT examples​
- create
- Manifest
Creates a new alarm in the specified compartment.<br />For more information, see<br />[Creating an Alarm](/iaas/Content/Monitoring/Tasks/create-alarm.htm).<br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br />
INSERT INTO oci.monitoring.alarms (
alarmSummary,
body,
compartmentId,
definedTags,
destinations,
displayName,
evaluationSlackDuration,
freeformTags,
isEnabled,
isNotificationsPerMetricDimensionEnabled,
messageFormat,
metricCompartmentId,
metricCompartmentIdInSubtree,
namespace,
notificationTitle,
notificationVersion,
overrides,
pendingDuration,
query,
repeatNotificationDuration,
resolution,
resourceGroup,
ruleName,
severity,
suppression,
region,
opc-request-id,
opc-retry-token
)
SELECT
'{{ alarmSummary }}',
'{{ body }}',
'{{ compartmentId }}' /* required */,
'{{ definedTags }}',
'{{ destinations }}' /* required */,
'{{ displayName }}' /* required */,
'{{ evaluationSlackDuration }}',
'{{ freeformTags }}',
{{ isEnabled }} /* required */,
{{ isNotificationsPerMetricDimensionEnabled }},
'{{ messageFormat }}',
'{{ metricCompartmentId }}' /* required */,
{{ metricCompartmentIdInSubtree }},
'{{ namespace }}' /* required */,
'{{ notificationTitle }}',
'{{ notificationVersion }}',
'{{ overrides }}',
'{{ pendingDuration }}',
'{{ query }}' /* required */,
'{{ repeatNotificationDuration }}',
'{{ resolution }}',
'{{ resourceGroup }}',
'{{ ruleName }}',
'{{ severity }}' /* required */,
'{{ suppression }}',
'{{ region }}',
'{{ opc-request-id }}',
'{{ opc-retry-token }}'
RETURNING
id,
alarmSummary,
body,
compartmentId,
definedTags,
destinations,
displayName,
evaluationSlackDuration,
freeformTags,
isEnabled,
isNotificationsPerMetricDimensionEnabled,
lifecycleState,
messageFormat,
metricCompartmentId,
metricCompartmentIdInSubtree,
namespace,
notificationTitle,
notificationVersion,
overrides,
pendingDuration,
query,
repeatNotificationDuration,
resolution,
resourceGroup,
ruleName,
severity,
suppression,
timeCreated,
timeUpdated
;
# Description fields are for documentation purposes
- name: alarms
props:
- name: region
value: "{{ region }}"
description: Required parameter for the alarms resource.
- name: alarmSummary
value: "{{ alarmSummary }}"
description: |
Customizable alarm summary (`alarmSummary` [alarm message parameter](/iaas/Content/Monitoring/alarm-message-format.htm)).
Optionally include [dynamic variables](/iaas/Content/Monitoring/Tasks/update-alarm-dynamic-variables.htm).
The alarm summary appears within the body of the alarm message and in responses to
[ListAlarmStatus](#/en/monitoring/latest/AlarmStatusSummary/ListAlarmsStatus)
[GetAlarmHistory](#/en/monitoring/latest/AlarmHistoryCollection/GetAlarmHistory) and
[RetrieveDimensionStates](#/en/monitoring/latest/AlarmDimensionStatesCollection/RetrieveDimensionStates).
- name: body
value: "{{ body }}"
description: |
The human-readable content of the delivered alarm notification.
Optionally include [dynamic variables](/iaas/Content/Monitoring/Tasks/update-alarm-dynamic-variables.htm).
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.`
- name: compartmentId
value: "{{ compartmentId }}"
description: |
The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the alarm.
- name: definedTags
value: "{{ definedTags }}"
description: |
Usage of predefined tag keys. These predefined keys are scoped to namespaces.
Example: `{"Operations": {"CostCenter": "42"}}`
- name: destinations
value:
- "{{ destinations }}"
description: |
A list of destinations for alarm notifications.
Each destination is represented by the [OCID](/iaas/Content/General/Concepts/identifiers.htm)
of a related resource, such as a [topic](#/en/notification/latest/NotificationTopic).
Supported destination services: Notifications, Streaming.
Limit: One destination per supported destination service.
- name: displayName
value: "{{ displayName }}"
description: |
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`
- name: evaluationSlackDuration
value: "{{ evaluationSlackDuration }}"
description: |
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](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#reset).
- name: freeformTags
value: "{{ freeformTags }}"
description: |
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only.
Example: `{"Department": "Finance"}`
- name: isEnabled
value: {{ isEnabled }}
description: |
Whether the alarm is enabled.
Example: `true`
- name: isNotificationsPerMetricDimensionEnabled
value: {{ isNotificationsPerMetricDimensionEnabled }}
description: |
When set to `true`, splits alarm notifications per metric stream.
When set to `false`, groups alarm notifications across metric streams.
Example: `true`
default: false
- name: messageFormat
value: "{{ messageFormat }}"
description: |
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.
valid_values: ['RAW', 'PRETTY_JSON', 'ONS_OPTIMIZED']
default: RAW
- name: metricCompartmentId
value: "{{ metricCompartmentId }}"
description: |
The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the metric
being evaluated by the alarm.
- name: metricCompartmentIdInSubtree
value: {{ metricCompartmentIdInSubtree }}
description: |
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`
- name: namespace
value: "{{ namespace }}"
description: |
The source service or application emitting the metric that is evaluated by the alarm.
Example: `oci_computeagent`
- name: notificationTitle
value: "{{ notificationTitle }}"
description: |
Customizable notification title (`title` [alarm message parameter](/iaas/Content/Monitoring/alarm-message-format.htm)).
Optionally include [dynamic variables](/iaas/Content/Monitoring/Tasks/update-alarm-dynamic-variables.htm).
The notification title appears as the subject line in a formatted email message and as the title in a Slack message.
- name: notificationVersion
value: "{{ notificationVersion }}"
description: |
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.
- name: overrides
description: |
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`).
value:
- body: "{{ body }}"
pendingDuration: "{{ pendingDuration }}"
query: "{{ query }}"
ruleName: "{{ ruleName }}"
severity: "{{ severity }}"
- name: pendingDuration
value: "{{ pendingDuration }}"
description: |
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: PT24H. 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`
- name: query
value: "{{ query }}"
description: |
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](/iaas/Content/Monitoring/Tasks/create-edit-alarm-query-absence-detection-period.htm).
Supported grouping functions: `grouping()`, `groupBy()`.
For information about writing MQL expressions, see
[Editing the MQL Expression for a Query](/iaas/Content/Monitoring/Tasks/query-metric-mql.htm).
For details about MQL, see
[Monitoring Query Language (MQL) Reference](/iaas/Content/Monitoring/Reference/mql.htm).
For available dimensions, review the metric definition for the supported service. See
[Supported Services](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices).
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)
-----
- name: repeatNotificationDuration
value: "{{ repeatNotificationDuration }}"
description: |
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.
As another example, `PT0M` indicates a repeat notification each time the alarm trigger condition is met,
otherwise known as an event-based notification. For more information, see
[Getting Event-Based Notifications for an Alarm](/iaas/Content/Monitoring/Tasks/update-alarm-event.htm).
Minimum: PT0M. Maximum: P30D.
Default value: null (notifications are not re-submitted).
- name: resolution
value: "{{ resolution }}"
description: |
The time between calculated aggregation windows for the alarm. Supported value: `1m`
- name: resourceGroup
value: "{{ resourceGroup }}"
description: |
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`
- name: ruleName
value: "{{ ruleName }}"
description: |
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](#/en/monitoring/latest/datatypes/AlarmOverride).
- name: severity
value: "{{ severity }}"
description: |
The perceived type of response required when the alarm is in the "FIRING" state.
- name: suppression
description: |
The configuration details for an alarm-wide suppression.
For dimension-specific suppressions, see [AlarmSuppression](#/en/monitoring/latest/AlarmSuppression).
For information about alarms, see
[Alarms Overview](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#AlarmsOverview).
value:
description: "{{ description }}"
timeSuppressFrom: "{{ timeSuppressFrom }}"
timeSuppressUntil: "{{ timeSuppressUntil }}"
- name: opc-request-id
value: "{{ opc-request-id }}"
description: Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.
description: Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.
- name: opc-retry-token
value: "{{ opc-retry-token }}"
description: A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
description: A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
UPDATE examples​
- update
Updates the specified alarm.<br />For more information, see<br />[Updating an Alarm](/iaas/Content/Monitoring/Tasks/update-alarm.htm).<br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br />
UPDATE oci.monitoring.alarms
SET
alarmSummary = '{{ alarmSummary }}',
body = '{{ body }}',
compartmentId = '{{ compartmentId }}',
definedTags = '{{ definedTags }}',
destinations = '{{ destinations }}',
displayName = '{{ displayName }}',
evaluationSlackDuration = '{{ evaluationSlackDuration }}',
freeformTags = '{{ freeformTags }}',
isEnabled = {{ isEnabled }},
isNotificationsPerMetricDimensionEnabled = {{ isNotificationsPerMetricDimensionEnabled }},
messageFormat = '{{ messageFormat }}',
metricCompartmentId = '{{ metricCompartmentId }}',
metricCompartmentIdInSubtree = {{ metricCompartmentIdInSubtree }},
namespace = '{{ namespace }}',
notificationTitle = '{{ notificationTitle }}',
notificationVersion = '{{ notificationVersion }}',
overrides = '{{ overrides }}',
pendingDuration = '{{ pendingDuration }}',
query = '{{ query }}',
repeatNotificationDuration = '{{ repeatNotificationDuration }}',
resolution = '{{ resolution }}',
resourceGroup = '{{ resourceGroup }}',
ruleName = '{{ ruleName }}',
severity = '{{ severity }}',
suppression = '{{ suppression }}'
WHERE
alarmId = '{{ alarmId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
AND opc-request-id = '{{ opc-request-id}}'
RETURNING
id,
alarmSummary,
body,
compartmentId,
definedTags,
destinations,
displayName,
evaluationSlackDuration,
freeformTags,
isEnabled,
isNotificationsPerMetricDimensionEnabled,
lifecycleState,
messageFormat,
metricCompartmentId,
metricCompartmentIdInSubtree,
namespace,
notificationTitle,
notificationVersion,
overrides,
pendingDuration,
query,
repeatNotificationDuration,
resolution,
resourceGroup,
ruleName,
severity,
suppression,
timeCreated,
timeUpdated;
DELETE examples​
- delete
Deletes the specified alarm.<br />For more information, see<br />[Deleting an Alarm](/iaas/Content/Monitoring/Tasks/delete-alarm.htm).<br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br />
DELETE FROM oci.monitoring.alarms
WHERE alarmId = '{{ alarmId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
AND opc-request-id = '{{ opc-request-id }}'
;
Lifecycle Methods​
- change_compartment
- remove_alarm_suppression
- retrieve_dimension_states
- summarize_alarm_suppression_history
Moves an alarm into a different compartment within the same tenancy.<br />For more information, see<br />[Moving an Alarm](/iaas/Content/Monitoring/Tasks/change-compartment-alarm.htm).<br />
EXEC oci.monitoring.alarms.change_compartment
@alarmId='{{ alarmId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}',
@opc-request-id='{{ opc-request-id }}',
@opc-retry-token='{{ opc-retry-token }}'
@@json=
'{
"compartmentId": "{{ compartmentId }}"
}'
;
Removes any existing suppression for the specified alarm.<br />For more information, see<br />[Removing a Suppression from a Single Alarm](/iaas/Content/Monitoring/Tasks/delete-alarm-suppression.htm) and<br />[Removing a Suppression from Multiple Alarms](/iaas/Content/Monitoring/Tasks/delete-alarm-suppression-multiple.htm).<br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br />
EXEC oci.monitoring.alarms.remove_alarm_suppression
@alarmId='{{ alarmId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}',
@opc-request-id='{{ opc-request-id }}'
;
Lists the current alarm status of each metric stream, where status is derived from the metric stream's last associated transition.<br />Optionally filter by status value and one or more dimension key-value pairs.<br /><br />For more information, see<br />[Listing Metric Stream Status in an Alarm](/iaas/Content/Monitoring/Tasks/list-alarm-status-metric-stream.htm).<br /><br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br />
EXEC oci.monitoring.alarms.retrieve_dimension_states
@alarmId='{{ alarmId }}' --required,
@region='{{ region }}' --required,
@opc-request-id='{{ opc-request-id }}',
@page='{{ page }}',
@limit='{{ limit }}'
@@json=
'{
"dimensionFilters": "{{ dimensionFilters }}",
"status": "{{ status }}"
}'
;
Returns history of suppressions for the specified alarm, including both dimension-specific and and alarm-wide suppressions. For more information, see<br />[Getting Suppression History for an Alarm](/iaas/Content/Monitoring/Tasks/summarize-alarm-suppression-history.htm).<br /><br />For important limits information, see<br />[Limits on Monitoring](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits).<br /><br />This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations.<br />Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests,<br />or transactions, per second (TPS) for a given tenancy.<br />
EXEC oci.monitoring.alarms.summarize_alarm_suppression_history
@alarmId='{{ alarmId }}' --required,
@region='{{ region }}' --required,
@opc-request-id='{{ opc-request-id }}',
@page='{{ page }}',
@limit='{{ limit }}'
@@json=
'{
"dimensions": "{{ dimensions }}",
"timeSuppressFromGreaterThanOrEqualTo": "{{ timeSuppressFromGreaterThanOrEqualTo }}",
"timeSuppressFromLessThan": "{{ timeSuppressFromLessThan }}"
}'
;