public postInstanceReboot ( $serviceName, $idInstance, $type = 'soft' ) : null | ||
return | null |
public function postInstanceReboot($serviceName, $idInstance, $type = 'soft')
{
if (!$serviceName) {
throw new BadMethodCallException('Missing parameter $serviceName (OVH Cloud Project).');
}
if (!$idInstance) {
throw new BadMethodCallException('Missing parameter $idInstance (OVH Cloud Instance ID).');
}
$post = array('type' => $type);
try {
$r = $this->post('cloud/project/' . $serviceName . '/instance/' . $idInstance . '/reboot', array('Content-Type' => 'application/json;charset=UTF-8'), json_encode($post))->send();
} catch (\Exception $e) {
throw new CloudException($e->getMessage(), $e->getCode(), $e);
}
return $r->getBody(true);
}