-
Type:
Incident report
-
Resolution: Won't fix
-
Priority:
Major
-
None
-
Affects Version/s: 2.2.17
-
Component/s: API (A)
-
None
I am trying to update timeperiod via api and i have been given this response.
string(134) "{"jsonrpc":"2.0","error":
{"code":-32602,"message":"Invalid params.","data":"At least one maintenance period must be created."}
,"id":1}"
The following is being sent to Zabbix api
$result = $this->sendRequest("maintenance.update",array(
"maintenanceid" => $id,
"name" => "test api",
"maintenance_type" => 0,
"description" =>"test api",
"active_since"=> $t->start_date,
"active_till" => $t->start_date+$t->period,
"groups" => array(),
"timeperiods" => array(
"timeperiodid" => $t->timeperiodid,
"timeperiod_type" => 0,
//"every" => 1,
//"month"=> "0",
//"dayofweek" => "0",
//"day" => "1",
//"start_time" => "43200",
"period" => $t->period,
"start_date" => $t->start_date,
),
));
Many Thanks for any advise.
The maitennace and period is already setup in Zabbix using frontend.
The api is to update pre existing timeperiod with new values.
I have also tried to comment timeperiod id and it did not worked as well.
Many Thanks
Raf