create
******


Description
===========

Creates a new alarm in the specified compartment.


Usage
=====

   oci monitoring alarm create [OPTIONS]


Options
=======


--display-name [text]
---------------------

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* [required]


--compartment-id, -c [text]
---------------------------

The OCID of the compartment containing the alarm. [required]


--metric-compartment-id [text]
------------------------------

The OCID of the compartment containing the metric being evaluated by
the alarm. [required]


--namespace [text]
------------------

The source service or application emitting the metric that is
evaluated by the alarm.

Example: *oci_computeagent* [required]


--severity [text]
-----------------

The perceived type of response required when the alarm is in the
"FIRING" state.

Example: *CRITICAL* [required]


--destinations [complex type]
-----------------------------

An array of OCIDs to which the notifications for this alarm will be
delivered. An example destination is an OCID for a topic managed by
the Oracle Cloud Infrastructure Notification service. This is a
complex type whose value must be valid JSON. The value can be provided
as a string on the command line or passed in as a file using the
file://path/to/file syntax.

The --generate-param-json-input option can be used to generate an
example of the JSON which must be provided. We recommend storing this
example in a file, modifying it as needed and then passing it back in
via the file:// syntax.

   [required]


--is-enabled [boolean]
----------------------

Whether the alarm is enabled.

Example: *true* [required]


--metric-compartment-id-in-subtree [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*


--resolution [text]
-------------------

The time between calculated aggregation windows for the alarm.
Supported value: *1m*


--pending-duration [text]
-------------------------

The period of time that the condition defined in the alarm must
persist before the alarm state changes from "OK" to "FIRING" or vice
versa. 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"; likewise, the alarm must persist in not
breaching the condition for five minutes before the alarm updates its
state to "OK."

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" and the first evaluation that
does not breach the alarm updates the state to "OK".

Example: *PT5M*


--body [text]
-------------

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.*


--repeat-notification-duration [text]
-------------------------------------

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*


--suppression [complex type]
----------------------------

The configuration details for suppressing an alarm. This is a complex
type whose value must be valid JSON. The value can be provided as a
string on the command line or passed in as a file using the
file://path/to/file syntax.

The --generate-param-json-input option can be used to generate an
example of the JSON which must be provided. We recommend storing this
example in a file, modifying it as needed and then passing it back in
via the file:// syntax.


--freeform-tags [complex type]
------------------------------

Simple key-value pair that is applied without any predefined name,
type or scope. Exists for cross-compatibility only. Example:
*{"Department": "Finance"}* This is a complex type whose value must be
valid JSON. The value can be provided as a string on the command line
or passed in as a file using the file://path/to/file syntax.

The --generate-param-json-input option can be used to generate an
example of the JSON which must be provided. We recommend storing this
example in a file, modifying it as needed and then passing it back in
via the file:// syntax.


--defined-tags [complex type]
-----------------------------

Usage of predefined tag keys. These predefined keys are scoped to
namespaces. Example: *{"Operations": {"CostCenter": "42"}}* This is a
complex type whose value must be valid JSON. The value can be provided
as a string on the command line or passed in as a file using the
file://path/to/file syntax.

The --generate-param-json-input option can be used to generate an
example of the JSON which must be provided. We recommend storing this
example in a file, modifying it as needed and then passing it back in
via the file:// syntax.


--wait-for-state [ACTIVE|DELETING|DELETED]
------------------------------------------

This operation creates, modifies or deletes a resource that has a
defined lifecycle state. Specify this option to perform the action and
then wait until the resource reaches a given lifecycle state. If
timeout is reached, a return code of 2 is returned. For any other
error, a return code of 1 is returned.


--max-wait-seconds [integer]
----------------------------

The maximum time to wait for the resource to reach the lifecycle state
defined by --wait-for-state. Defaults to 1200 seconds.


--wait-interval-seconds [integer]
---------------------------------

Check every --wait-interval-seconds to see whether the resource to see
if it has reached the lifecycle state defined by --wait-for-state.
Defaults to 30 seconds.


--query-text [text]
-------------------

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: *1m*-*60m* (also *1h*). 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()

   ----- [required]


--from-json [text]
------------------

Provide input to this command as a JSON document from a file using the
file://path-to/file syntax.

The --generate-full-command-json-input option can be used to generate
a sample json file to be used with this command option. The key names
are pre-populated and match the command option names (converted to
camelCase format, e.g. compartment-id --> compartmentId), while the
values of the keys need to be populated by the user before using the
sample file as an input to this command. For any command option that
accepts multiple values, the value of the key can be a JSON array.

Options can still be provided on the command line. If an option exists
in both the JSON document and the command line then the command line
specified value will be used.

For examples on usage of this option, please see our "using CLI with
advanced JSON options" link: https://docs.cloud.oracle.com/iaas/Conte
nt/API/SDKDocs/cliusing.htm#AdvancedJSONOptions


-?, -h, --help
--------------

For detailed help on any of these individual commands, enter <command>
--help.
