我使用非脚本从AWS实例中检索内存在aws控制台,一切都是好的,但在API数据点只是返回空它真的很令人困惑,因为在boto(Python Version)中,一切正常,响应正确,但在php中,不是
这是我的代码
header("Content-type: text/html; charset=utf-8");
require_once '../sdk.class.php';
$cw = new AmazonCloudWatch();
$response = $cw->get_metric_statistics(
'System/Linux', 'MemoryUtilization',
date("c", strtotime('-5 minute')),
date("c", strtotime('now')),
300,
'Average',
'Percent',
array('Name'=> 'InstanceId', 'Value'=>'i-8c15b124')
);
我对PHP一无所知,但您正在调用的date
函数是否返回UTC时间?如果没有,那可能是问题,因为服务期望时间戳是UTC。
升级到version3 API解决我认为这是一个基于时间戳的问题,与php