public function updateDir($key, $ttl)
{
if (!$ttl) {
throw new EtcdException('TTL is required', 204);
}
$condition = array('dir' => 'true', 'prevExist' => 'true');
$request = $this->guzzleclient->put($this->buildKeyUri($key), null, array('ttl' => (int) $ttl), array('query' => $condition));
$response = $request->send();
$body = $response->json();
if (isset($body['errorCode'])) {
throw new EtcdException($body['message'], $body['errorCode']);
}
return $body;
}