Пример #1
0
 /**
  * Reads the value of the key at the given path.
  *
  * This is the raw path in the storage backend and not the logical path that is exposed via the mount system.
  *
  * If `$value` is empty, GET is assumed - otherwise PUT.
  *
  * @see    https://www.vaultproject.io/docs/http/sys-raw.html
  * @param  string $path
  * @param  string|null $value
  * @return mixed
  */
 public function raw($path, $value = null)
 {
     if ($value === null) {
         return $this->client->get('/v1/sys/raw/' . $path);
     }
     $params = ['body' => json_encode(compact('value'))];
     return $this->client->put('/v1/sys/raw/' . $path, $params);
 }
Пример #2
0
 public function write($path, $body)
 {
     $params = ['body' => json_encode($body)];
     return $this->client->put('/v1/' . $path, $params);
 }