{
  "description": "MetricAlarm is the Schema for the MetricAlarms API",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "MetricAlarmSpec defines the desired state of MetricAlarm.\n\nThe details about a metric alarm.",
      "properties": {
        "actionsEnabled": {
          "description": "Indicates whether actions should be executed during any changes to the alarm\nstate. The default is TRUE.",
          "type": "boolean"
        },
        "alarmActions": {
          "description": "The actions to execute when this alarm transitions to the ALARM state from\nany other state. Each action is specified as an Amazon Resource Name (ARN).\nValid values:\n\nEC2 actions:\n\n  - arn:aws:automate:region:ec2:stop\n\n  - arn:aws:automate:region:ec2:terminate\n\n  - arn:aws:automate:region:ec2:reboot\n\n  - arn:aws:automate:region:ec2:recover\n\n  - arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0\n\n  - arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0\n\n  - arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0\n\n  - arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0\n\nAutoscaling action:\n\n  - arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name\n\nLambda actions:\n\n  - Invoke the latest version of a Lambda function: arn:aws:lambda:region:account-id:function:function-name\n\n  - Invoke a specific version of a Lambda function: arn:aws:lambda:region:account-id:function:function-name:version-number\n\n  - Invoke a function by using an alias Lambda function: arn:aws:lambda:region:account-id:function:function-name:alias-name\n\nSNS notification action:\n\n  - arn:aws:sns:region:account-id:sns-topic-name\n\nSSM integration actions:\n\n  - arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name\n\n  - arn:aws:ssm-incidents::account-id:responseplan/response-plan-name",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "alarmDescription": {
          "description": "The description for the alarm.",
          "type": "string"
        },
        "comparisonOperator": {
          "description": "The arithmetic operation to use when comparing the specified statistic and\nthreshold. The specified statistic value is used as the first operand.\n\nThe values LessThanLowerOrGreaterThanUpperThreshold, LessThanLowerThreshold,\nand GreaterThanUpperThreshold are used only for alarms based on anomaly detection\nmodels.",
          "type": "string"
        },
        "datapointsToAlarm": {
          "description": "The number of data points that must be breaching to trigger the alarm. This\nis used only if you are setting an \"M out of N\" alarm. In that case, this\nvalue is the M. For more information, see Evaluating an Alarm (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation)\nin the Amazon CloudWatch User Guide.",
          "format": "int64",
          "type": "integer"
        },
        "dimensions": {
          "description": "The dimensions for the metric specified in MetricName.",
          "items": {
            "description": "A dimension is a name/value pair that is part of the identity of a metric.\nBecause dimensions are part of the unique identifier for a metric, whenever\nyou add a unique name/value pair to one of your metrics, you are creating\na new variation of that metric. For example, many Amazon EC2 metrics publish\nInstanceId as a dimension name, and the actual instance ID as the value for\nthat dimension.\n\nYou can assign up to 30 dimensions to a metric.",
            "properties": {
              "name": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "evaluateLowSampleCountPercentile": {
          "description": "Used only for alarms based on percentiles. If you specify ignore, the alarm\nstate does not change during periods with too few data points to be statistically\nsignificant. If you specify evaluate or omit this parameter, the alarm is\nalways evaluated and possibly changes state no matter how many data points\nare available. For more information, see Percentile-Based CloudWatch Alarms\nand Low Data Samples (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#percentiles-with-low-samples).\n\nValid Values: evaluate | ignore",
          "type": "string"
        },
        "evaluationPeriods": {
          "description": "The number of periods over which data is compared to the specified threshold.\nIf you are setting an alarm that requires that a number of consecutive data\npoints be breaching to trigger the alarm, this value specifies that number.\nIf you are setting an \"M out of N\" alarm, this value is the N.\n\nAn alarm's total current evaluation period can be no longer than one day,\nso this number multiplied by Period cannot be more than 86,400 seconds.",
          "format": "int64",
          "type": "integer"
        },
        "extendedStatistic": {
          "description": "The extended statistic for the metric specified in MetricName. When you call\nPutMetricAlarm and specify a MetricName, you must specify either Statistic\nor ExtendedStatistic but not both.\n\nIf you specify ExtendedStatistic, the following are valid values:\n\n  - p90\n\n  - tm90\n\n  - tc90\n\n  - ts90\n\n  - wm90\n\n  - IQM\n\n  - PR(n:m) where n and m are values of the metric\n\n  - TC(X%:X%) where X is between 10 and 90 inclusive.\n\n  - TM(X%:X%) where X is between 10 and 90 inclusive.\n\n  - TS(X%:X%) where X is between 10 and 90 inclusive.\n\n  - WM(X%:X%) where X is between 10 and 90 inclusive.\n\nFor more information about these extended statistics, see CloudWatch statistics\ndefinitions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html).",
          "type": "string"
        },
        "insufficientDataActions": {
          "description": "The actions to execute when this alarm transitions to the INSUFFICIENT_DATA\nstate from any other state. Each action is specified as an Amazon Resource\nName (ARN). Valid values:\n\nEC2 actions:\n\n  - arn:aws:automate:region:ec2:stop\n\n  - arn:aws:automate:region:ec2:terminate\n\n  - arn:aws:automate:region:ec2:reboot\n\n  - arn:aws:automate:region:ec2:recover\n\n  - arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0\n\n  - arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0\n\n  - arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0\n\n  - arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0\n\nAutoscaling action:\n\n  - arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name\n\nLambda actions:\n\n  - Invoke the latest version of a Lambda function: arn:aws:lambda:region:account-id:function:function-name\n\n  - Invoke a specific version of a Lambda function: arn:aws:lambda:region:account-id:function:function-name:version-number\n\n  - Invoke a function by using an alias Lambda function: arn:aws:lambda:region:account-id:function:function-name:alias-name\n\nSNS notification action:\n\n  - arn:aws:sns:region:account-id:sns-topic-name\n\nSSM integration actions:\n\n  - arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name\n\n  - arn:aws:ssm-incidents::account-id:responseplan/response-plan-name",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "metricName": {
          "description": "The name for the metric associated with the alarm. For each PutMetricAlarm\noperation, you must specify either MetricName or a Metrics array.\n\nIf you are creating an alarm based on a math expression, you cannot specify\nthis parameter, or any of the Namespace, Dimensions, Period, Unit, Statistic,\nor ExtendedStatistic parameters. Instead, you specify all this information\nin the Metrics array.",
          "type": "string"
        },
        "metrics": {
          "description": "An array of MetricDataQuery structures that enable you to create an alarm\nbased on the result of a metric math expression. For each PutMetricAlarm\noperation, you must specify either MetricName or a Metrics array.\n\nEach item in the Metrics array either retrieves a metric or performs a math\nexpression.\n\nOne item in the Metrics array is the expression that the alarm watches. You\ndesignate this expression by setting ReturnData to true for this object in\nthe array. For more information, see MetricDataQuery (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDataQuery.html).\n\nIf you use the Metrics parameter, you cannot include the Namespace, MetricName,\nDimensions, Period, Unit, Statistic, or ExtendedStatistic parameters of PutMetricAlarm\nin the same operation. Instead, you retrieve the metrics you are using in\nyour math expression as part of the Metrics array.",
          "items": {
            "description": "This structure is used in both GetMetricData and PutMetricAlarm. The supported\nuse of this structure is different for those two operations.\n\nWhen used in GetMetricData, it indicates the metric data to return, and whether\nthis call is just retrieving a batch set of data for one metric, or is performing\na Metrics Insights query or a math expression. A single GetMetricData call\ncan include up to 500 MetricDataQuery structures.\n\nWhen used in PutMetricAlarm, it enables you to create an alarm based on a\nmetric math expression. Each MetricDataQuery in the array specifies either\na metric to retrieve, or a math expression to be performed on retrieved metrics.\nA single PutMetricAlarm call can include up to 20 MetricDataQuery structures\nin the array. The 20 structures can include as many as 10 structures that\ncontain a MetricStat parameter to retrieve a metric, and as many as 10 structures\nthat contain the Expression parameter to perform a math expression. Of those\nExpression structures, one must have true as the value for ReturnData. The\nresult of this expression is the value the alarm watches.\n\nAny expression used in a PutMetricAlarm operation must return a single time\nseries. For more information, see Metric Math Syntax and Functions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax)\nin the Amazon CloudWatch User Guide.\n\nSome of the parameters of this structure also have different uses whether\nyou are using this structure in a GetMetricData operation or a PutMetricAlarm\noperation. These differences are explained in the following parameter list.",
            "properties": {
              "accountID": {
                "type": "string"
              },
              "expression": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "metricStat": {
                "description": "This structure defines the metric to be returned, along with the statistics,\nperiod, and units.",
                "properties": {
                  "metric": {
                    "description": "Represents a specific metric.",
                    "properties": {
                      "dimensions": {
                        "items": {
                          "description": "A dimension is a name/value pair that is part of the identity of a metric.\nBecause dimensions are part of the unique identifier for a metric, whenever\nyou add a unique name/value pair to one of your metrics, you are creating\na new variation of that metric. For example, many Amazon EC2 metrics publish\nInstanceId as a dimension name, and the actual instance ID as the value for\nthat dimension.\n\nYou can assign up to 30 dimensions to a metric.",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          },
                          "type": "object",
                          "additionalProperties": false
                        },
                        "type": "array"
                      },
                      "metricName": {
                        "type": "string"
                      },
                      "namespace": {
                        "type": "string"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "period": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "stat": {
                    "type": "string"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "period": {
                "format": "int64",
                "type": "integer"
              },
              "returnData": {
                "type": "boolean"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "name": {
          "description": "The name for the alarm. This name must be unique within the Region.\n\nThe name must contain only UTF-8 characters, and can't contain ASCII control\ncharacters",
          "type": "string"
        },
        "namespace": {
          "description": "The namespace for the metric associated specified in MetricName.",
          "type": "string"
        },
        "oKActions": {
          "description": "The actions to execute when this alarm transitions to an OK state from any\nother state. Each action is specified as an Amazon Resource Name (ARN). Valid\nvalues:\n\nEC2 actions:\n\n  - arn:aws:automate:region:ec2:stop\n\n  - arn:aws:automate:region:ec2:terminate\n\n  - arn:aws:automate:region:ec2:reboot\n\n  - arn:aws:automate:region:ec2:recover\n\n  - arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0\n\n  - arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0\n\n  - arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0\n\n  - arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0\n\nAutoscaling action:\n\n  - arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name\n\nLambda actions:\n\n  - Invoke the latest version of a Lambda function: arn:aws:lambda:region:account-id:function:function-name\n\n  - Invoke a specific version of a Lambda function: arn:aws:lambda:region:account-id:function:function-name:version-number\n\n  - Invoke a function by using an alias Lambda function: arn:aws:lambda:region:account-id:function:function-name:alias-name\n\nSNS notification action:\n\n  - arn:aws:sns:region:account-id:sns-topic-name\n\nSSM integration actions:\n\n  - arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name\n\n  - arn:aws:ssm-incidents::account-id:responseplan/response-plan-name",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "period": {
          "description": "The length, in seconds, used each time the metric specified in MetricName\nis evaluated. Valid values are 10, 30, and any multiple of 60.\n\nPeriod is required for alarms based on static thresholds. If you are creating\nan alarm based on a metric math expression, you specify the period for each\nmetric within the objects in the Metrics array.\n\nBe sure to specify 10 or 30 only for metrics that are stored by a PutMetricData\ncall with a StorageResolution of 1. If you specify a period of 10 or 30 for\na metric that does not have sub-minute resolution, the alarm still attempts\nto gather data at the period rate that you specify. In this case, it does\nnot receive data for the attempts that do not correspond to a one-minute\ndata resolution, and the alarm might often lapse into INSUFFICENT_DATA status.\nSpecifying 10 or 30 also sets this alarm as a high-resolution alarm, which\nhas a higher charge than other alarms. For more information about pricing,\nsee Amazon CloudWatch Pricing (https://aws.amazon.com/cloudwatch/pricing/).\n\nAn alarm's total current evaluation period can be no longer than one day,\nso Period multiplied by EvaluationPeriods cannot be more than 86,400 seconds.",
          "format": "int64",
          "type": "integer"
        },
        "statistic": {
          "description": "The statistic for the metric specified in MetricName, other than percentile.\nFor percentile statistics, use ExtendedStatistic. When you call PutMetricAlarm\nand specify a MetricName, you must specify either Statistic or ExtendedStatistic,\nbut not both.",
          "type": "string"
        },
        "tags": {
          "description": "A list of key-value pairs to associate with the alarm. You can associate\nas many as 50 tags with an alarm. To be able to associate tags with the alarm\nwhen you create the alarm, you must have the cloudwatch:TagResource permission.\n\nTags can help you organize and categorize your resources. You can also use\nthem to scope user permissions by granting a user permission to access or\nchange only resources with certain tag values.\n\nIf you are using this operation to update an existing alarm, any tags you\nspecify in this parameter are ignored. To change the tags of an existing\nalarm, use TagResource (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html)\nor UntagResource (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_UntagResource.html).\n\nTo use this field to set tags for an alarm when you create it, you must be\nsigned on with both the cloudwatch:PutMetricAlarm and cloudwatch:TagResource\npermissions.",
          "items": {
            "description": "A key-value pair associated with a CloudWatch resource.",
            "properties": {
              "key": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "threshold": {
          "description": "The value against which the specified statistic is compared.\n\nThis parameter is required for alarms based on static thresholds, but should\nnot be used for alarms based on anomaly detection models.",
          "type": "number"
        },
        "thresholdMetricID": {
          "description": "If this is an alarm based on an anomaly detection model, make this value\nmatch the ID of the ANOMALY_DETECTION_BAND function.\n\nFor an example of how to use this parameter, see the Anomaly Detection Model\nAlarm example on this page.\n\nIf your alarm uses this parameter, it cannot have Auto Scaling actions.",
          "type": "string"
        },
        "treatMissingData": {
          "description": "Sets how this alarm is to handle missing data points. If TreatMissingData\nis omitted, the default behavior of missing is used. For more information,\nsee Configuring How CloudWatch Alarms Treats Missing Data (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data).\n\nValid Values: breaching | notBreaching | ignore | missing\n\nAlarms that evaluate metrics in the AWS/DynamoDB namespace always ignore\nmissing data even if you choose a different option for TreatMissingData.\nWhen an AWS/DynamoDB metric has missing data, alarms that evaluate that metric\nremain in their current state.",
          "type": "string"
        },
        "unit": {
          "description": "The unit of measure for the statistic. For example, the units for the Amazon\nEC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes\nthat an instance receives on all network interfaces. You can also specify\na unit when you create a custom metric. Units help provide conceptual meaning\nto your data. Metric data points that specify a unit of measure, such as\nPercent, are aggregated separately. If you are creating an alarm based on\na metric math expression, you can specify the unit for each metric (if needed)\nwithin the objects in the Metrics array.\n\nIf you don't specify Unit, CloudWatch retrieves all unit types that have\nbeen published for the metric and attempts to evaluate the alarm. Usually,\nmetrics are published with only one unit, so the alarm works as intended.\n\nHowever, if the metric is published with multiple types of units and you\ndon't specify a unit, the alarm's behavior is not defined and it behaves\nunpredictably.\n\nWe recommend omitting Unit so that you don't inadvertently specify an incorrect\nunit that is not published for this metric. Doing so causes the alarm to\nbe stuck in the INSUFFICIENT DATA state.",
          "type": "string"
        }
      },
      "required": [
        "comparisonOperator",
        "evaluationPeriods",
        "name"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "MetricAlarmStatus defines the observed state of MetricAlarm",
      "properties": {
        "ackResourceMetadata": {
          "description": "All CRs managed by ACK have a common `Status.ACKResourceMetadata` member\nthat is used to contain resource sync state, account ownership,\nconstructed ARN for the resource",
          "properties": {
            "arn": {
              "description": "ARN is the Amazon Resource Name for the resource. This is a\nglobally-unique identifier and is set only by the ACK service controller\nonce the controller has orchestrated the creation of the resource OR\nwhen it has verified that an \"adopted\" resource (a resource where the\nARN annotation was set by the Kubernetes user on the CR) exists and\nmatches the supplied CR's Spec field values.\nhttps://github.com/aws/aws-controllers-k8s/issues/270",
              "type": "string"
            },
            "ownerAccountID": {
              "description": "OwnerAccountID is the AWS Account ID of the account that owns the\nbackend AWS service API resource.",
              "type": "string"
            },
            "region": {
              "description": "Region is the AWS region in which the resource exists or will exist.",
              "type": "string"
            }
          },
          "required": [
            "ownerAccountID",
            "region"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "conditions": {
          "description": "All CRs managed by ACK have a common `Status.Conditions` member that\ncontains a collection of `ackv1alpha1.Condition` objects that describe\nthe various terminal states of the CR and its backend AWS service API\nresource",
          "items": {
            "description": "Condition is the common struct used by all CRDs managed by ACK service\ncontrollers to indicate terminal states  of the CR and its backend AWS\nservice API resource",
            "properties": {
              "lastTransitionTime": {
                "description": "Last time the condition transitioned from one status to another.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "A human readable message indicating details about the transition.",
                "type": "string"
              },
              "reason": {
                "description": "The reason for the condition's last transition.",
                "type": "string"
              },
              "status": {
                "description": "Status of the condition, one of True, False, Unknown.",
                "type": "string"
              },
              "type": {
                "description": "Type is the type of the Condition",
                "type": "string"
              }
            },
            "required": [
              "status",
              "type"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
