# CloudWatch Service API Requests use [`CloudEnvAction`](../../../models.py): `service`, `operation`, and `payload` (boto3 parameters for the operation). Operations are enforced by IAM as `cloudwatch:` (see adapter). ## Operations ### PutMetricData _Boto3 client method: `put_metric_data`_ **Other boto3 parameters (optional):** `EntityMetricData, MetricData, StrictEntityValidation` ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "PutMetricData", "payload": { "Namespace": "example-namespace" } } ``` --- ### GetMetricStatistics _Boto3 client method: `get_metric_statistics`_ **Other boto3 parameters (optional):** `Dimensions, ExtendedStatistics, Statistics, Unit` ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "GetMetricStatistics", "payload": { "Namespace": "example-namespace", "MetricName": "example-metricname", "StartTime": "2024-01-01T00:00:00Z", "EndTime": "2024-01-01T00:00:00Z", "Period": 0 } } ``` --- ### GetMetricData _Boto3 client method: `get_metric_data`_ **Other boto3 parameters (optional):** `LabelOptions, MaxDatapoints, NextToken, ScanBy` ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "GetMetricData", "payload": { "MetricDataQueries": [ { "Id": "example-metricid" } ], "StartTime": "2024-01-01T00:00:00Z", "EndTime": "2024-01-01T00:00:00Z" } } ``` --- ### ListMetrics _Boto3 client method: `list_metrics`_ **Other boto3 parameters (optional):** `Dimensions, IncludeLinkedAccounts, MetricName, Namespace, NextToken, OwningAccount, RecentlyActive` ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "ListMetrics", "payload": {} } ``` --- ### PutMetricAlarm _Boto3 client method: `put_metric_alarm`_ **Other boto3 parameters (optional):** `ActionsEnabled, AlarmActions, AlarmDescription, DatapointsToAlarm, Dimensions, EvaluateLowSampleCountPercentile, ExtendedStatistic, InsufficientDataActions, MetricName, Metrics, Namespace, OKActions, Period, Statistic, Tags, Threshold, ThresholdMetricId, TreatMissingData, Unit` ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "PutMetricAlarm", "payload": { "AlarmName": "example-alarmname", "EvaluationPeriods": 0, "ComparisonOperator": "GreaterThanOrEqualToThreshold" } } ``` --- ### PutCompositeAlarm _Boto3 client method: `put_composite_alarm`_ **Other boto3 parameters (optional):** `ActionsEnabled, ActionsSuppressor, ActionsSuppressorExtensionPeriod, ActionsSuppressorWaitPeriod, AlarmActions, AlarmDescription, InsufficientDataActions, OKActions, Tags` ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "PutCompositeAlarm", "payload": { "AlarmName": "example-alarmname", "AlarmRule": "example-alarmrule" } } ``` --- ### DescribeAlarms _Boto3 client method: `describe_alarms`_ **Other boto3 parameters (optional):** `ActionPrefix, AlarmNamePrefix, AlarmNames, AlarmTypes, ChildrenOfAlarmName, MaxRecords, NextToken, ParentsOfAlarmName, StateValue` ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "DescribeAlarms", "payload": {} } ``` --- ### DescribeAlarmsForMetric _Boto3 client method: `describe_alarms_for_metric`_ **Other boto3 parameters (optional):** `Dimensions, ExtendedStatistic, Period, Statistic, Unit` ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "DescribeAlarmsForMetric", "payload": { "MetricName": "example-metricname", "Namespace": "example-namespace" } } ``` --- ### DescribeAlarmHistory _Boto3 client method: `describe_alarm_history`_ **Other boto3 parameters (optional):** `AlarmContributorId, AlarmName, AlarmTypes, EndDate, HistoryItemType, MaxRecords, NextToken, ScanBy, StartDate` ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "DescribeAlarmHistory", "payload": {} } ``` --- ### DeleteAlarms _Boto3 client method: `delete_alarms`_ ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "DeleteAlarms", "payload": { "AlarmNames": [ "example-alarmname" ] } } ``` --- ### SetAlarmState _Boto3 client method: `set_alarm_state`_ **Other boto3 parameters (optional):** `StateReasonData` ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "SetAlarmState", "payload": { "AlarmName": "example-alarmname", "StateValue": "OK", "StateReason": "example-statereason" } } ``` --- ### EnableAlarmActions _Boto3 client method: `enable_alarm_actions`_ ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "EnableAlarmActions", "payload": { "AlarmNames": [ "example-alarmname" ] } } ``` --- ### DisableAlarmActions _Boto3 client method: `disable_alarm_actions`_ ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "DisableAlarmActions", "payload": { "AlarmNames": [ "example-alarmname" ] } } ``` --- ### TagResource _Boto3 client method: `tag_resource`_ ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "TagResource", "payload": { "ResourceARN": "example-amazonresourcename", "Tags": [ { "Key": "example-tagkey", "Value": "example-tagvalue" } ] } } ``` --- ### UntagResource _Boto3 client method: `untag_resource`_ ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "UntagResource", "payload": { "ResourceARN": "example-amazonresourcename", "TagKeys": [ "example-tagkey" ] } } ``` --- ### ListTagsForResource _Boto3 client method: `list_tags_for_resource`_ ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "ListTagsForResource", "payload": { "ResourceARN": "example-amazonresourcename" } } ``` --- ### PutDashboard _Boto3 client method: `put_dashboard`_ ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "PutDashboard", "payload": { "DashboardName": "example-dashboardname", "DashboardBody": "example-dashboardbody" } } ``` --- ### GetDashboard _Boto3 client method: `get_dashboard`_ ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "GetDashboard", "payload": { "DashboardName": "example-dashboardname" } } ``` --- ### DeleteDashboards _Boto3 client method: `delete_dashboards`_ ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "DeleteDashboards", "payload": { "DashboardNames": [ "example-dashboardname" ] } } ``` --- ### ListDashboards _Boto3 client method: `list_dashboards`_ **Other boto3 parameters (optional):** `DashboardNamePrefix, NextToken` ```bash curl -X POST http://localhost:8000/step \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "service": "cloudwatch", "operation": "ListDashboards", "payload": {} } ``` ---