Download server/providers/aws/cloudwatch_api.md from Vishvam10/cloudenv: direct link, hf CLI and curl.
- Browser
- Download file 8.44 kB
-
https://huggingface.co/spaces/Vishvam10/cloudenv/resolve/main/server/providers/aws/cloudwatch_api.md
- Command line
-
hf download hf://spaces/Vishvam10/cloudenv/server/providers/aws/cloudwatch_api.md
-
curl -L -o cloudwatch_api.md https://huggingface.co/spaces/Vishvam10/cloudenv/resolve/main/server/providers/aws/cloudwatch_api.md
CloudWatch Service API
Requests use CloudEnvAction: service, operation, and payload (boto3 parameters for the operation).
Operations are enforced by IAM as cloudwatch:<OperationName> (see adapter).
Operations
PutMetricData
Boto3 client method: put_metric_data
Other boto3 parameters (optional): EntityMetricData, MetricData, StrictEntityValidation
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
curl -X POST http://localhost:8000/step \
-H "Content-Type: application/json" \
-d @- <<'EOF'
{
"service": "cloudwatch",
"operation": "ListDashboards",
"payload": {}
}