Проще всего было бы его POST.
Вот документация о том, как создать запрос POST для CloudWatch: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/making-api-requests.html#CloudWatch -API-запросы-using-post-method
Ниже приведен пример запроса, который вы можете использовать. Сохраните JSON ниже в файл и импортируйте в почтальон. Вам также необходимо создать среду и предоставить ACCESS_KEY_ID
, SECRET_ACCESS_KEY
и REGION
.
{
"info": {
"name": "CloudWatch",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "GetMetricData",
"request": {
"auth": {
"type": "awsv4",
"awsv4": [
{
"key": "service",
"value": "monitoring",
"type": "string"
},
{
"key": "region",
"value": "{{REGION}}",
"type": "string"
},
{
"key": "secretKey",
"value": "{{SECRET_ACCESS_KEY}}",
"type": "string"
},
{
"key": "accessKey",
"value": "{{ACCESS_KEY_ID}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
},
{
"key": "X-Amz-Target",
"value": "GraniteServiceVersion20100801.GetMetricData",
"type": "text"
},
{
"key": "host",
"value": "monitoring.{{REGION}}.amazonaws.com",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
},
{
"key": "Content-Encoding",
"value": "amz-1.0",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"MetricDataQueries\" : [\n {\n \"Id\": \"id\",\n \"MetricStat\": {\n \"Metric\": {\n \"Namespace\": \"AWS/DynamoDB\",\n \"MetricName\": \"ConsumedReadCapacityUnits\",\n \"Dimensions\": [\n {\n \"Name\": \"TableName\",\n \"Value\": \"test\"\n }\n ]\n },\n \"Period\": 60,\n \"Stat\": \"Average\"\n },\n \"ReturnData\": true\n }\n ],\n \"StartTime\": 1581719303,\n \"EndTime\": 1581722903\n}"
},
"url": {
"raw": "https://monitoring.{{REGION}}.amazonaws.com",
"protocol": "https",
"host": [
"monitoring",
"{{REGION}}",
"amazonaws",
"com"
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
}