dongzhang4301 2016-03-03 04:26
浏览 95

什么是openstack云高仪报警创建错误“缺少参数:\”数据\“”

I facing this error :

*{"error_message": {"debuginfo": null, "faultcode": "Client", "faultstring":    "Missing argument: \"data\""}}*

I am doing the rest call in php for alarm creation as

$json = '\'{"alarm_actions": ["log:///tmp/tst.txt"], "description":  " Test of CPU usage high", "threshold_rule": {"meter_name": "cpu_usage_high", "evaluation_periods": 2, "period": 10, "statistic": "avg", "threshold": 40.0,"query":[{"field": "resource_id", "type": "", "value": "500a1594-4972-7968-2914-c333201585bd", "op": "eq"}], "comparison_operator": "gt" }, "repeat_actions": "FALSE", "type": "threshold", "name": "cpu_high_alarm_ada_9007"}\'';

$result = json_decode ($json);

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER,$headers );
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS,$result);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);


$result     = curl_exec($curl);
  • 写回答

1条回答 默认 最新

  • dsfds4551 2016-03-04 10:34
    关注

    To check validity of json use online json validator.

    Here, in json data i was sending "False" (With quotes). But server was expecting data false(without quotes).

    评论

报告相同问题?

问题事件

  • 请提交代码 5月11日