/** * Perform host update operation * * @param Host $host modified Host object * * @return str json response */ public function update(Host $host, $cltrid = false) { $requestData = $this->getRequestData(__FUNCTION__, $host); // do not send api request if object state is the same if (!count($requestData['add']) && !count($requestData['rem']) && !count($requestData['chg'])) { return json_encode(array("code" => 1000, "message" => "OK; WARNING: No changes has been made;", "cltrid" => $cltrid ?: ApiRequest::defaultClientTransactionID(), "svtrid" => "NO_TRANSACTION", "time" => 0)); } $json = APIRequest::POST(sprintf("/hosts/%s", $host->getName()), $cltrid ?: ApiRequest::defaultClientTransactionID(), STRegistry::Session()->getAuthToken(), array(), $requestData); return $json; }
/** * Mark notification as read * * @param int $messageId Message id recieved by request call * * @return str json response */ public function ack($messageId, $cltrid = false) { $json = APIRequest::POST(sprintf("/notifications/%d/read", $messageId), $cltrid ?: APIRequest::defaultClientTransactionID(), STRegistry::Session()->getAuthToken()); return $json; }
/** * Approve domain transfer * * @param str $domainName * * @return str json response */ public function transferApprove($domainName, $cltrid = false) { $requestData = array('op' => 'approve'); $json = APIRequest::POST(sprintf("/domains/%s/transfer", $domainName), $cltrid ?: ApiRequest::defaultClientTransactionID(), STRegistry::Session()->getAuthToken(), array(), $requestData); return $json; }