Elastica\Snapshot::createSnapshot PHP Метод

createSnapshot() публичный Метод

Create a new snapshot.
public createSnapshot ( string $repository, string $name, array $options = [], boolean $waitForCompletion = false ) : Response
$repository string the name of the repository in which this snapshot should be stored
$name string the name of this snapshot
$options array optional settings for this snapshot
$waitForCompletion boolean if true, the request will not return until the snapshot operation is complete
Результат Response
    public function createSnapshot($repository, $name, $options = [], $waitForCompletion = false)
    {
        return $this->request($repository . '/' . $name, Request::PUT, $options, ['wait_for_completion' => $waitForCompletion]);
    }

Usage Example

Пример #1
0
 /**
  * Méthode permettant la création du snapshot
  *
  * @param string $repositoryName Le nom du répertoire
  * @param string $location       Le chemin du répertoire
  * @param string $snapshotName   Le nom du snapshot
  *
  * @return bool Création effectuée ou non
  */
 public function snapshot($repositoryName, $location, $snapshotName)
 {
     // register the repository
     $this->registerRepository($repositoryName, $location);
     if ($this->getSnapshot($repositoryName, $snapshotName)) {
         $this->deleteSnapshot($repositoryName, $snapshotName);
     }
     $response = $this->_snapshot->createSnapshot($repositoryName, $snapshotName, array("indices" => $this->_index->getName()), true);
     return $response->isOk();
 }
All Usage Examples Of Elastica\Snapshot::createSnapshot