PHP Class Elastica\Snapshot

Show file Open project: ruflin/elastica Class Usage Examples

Protected Properties

Property Type Description
$_client Client

Public Methods

Method Description
__construct ( Client $client )
createSnapshot ( string $repository, string $name, array $options = [], boolean $waitForCompletion = false ) : Response Create a new snapshot.
deleteSnapshot ( string $repository, string $name ) : Response Delete a snapshot.
getAllRepositories ( ) : array Retrieve all repository records.
getAllSnapshots ( string $repository ) : array Retrieve data regarding all snapshots in the given repository.
getRepository ( string $name ) : array Retrieve a repository record by name.
getSnapshot ( string $repository, string $name ) : array Retrieve data regarding a specific snapshot.
registerRepository ( string $name, string $type, array $settings = [] ) : Response Register a snapshot repository.
request ( string $path, string $method = Request::GET, array $data = [], array $query = [] ) : Response Perform a snapshot request.
restoreSnapshot ( string $repository, string $name, array $options = [], boolean $waitForCompletion = false ) : Response Restore a snapshot.

Method Details

__construct() public method

public __construct ( Client $client )
$client Client

createSnapshot() public method

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
return Response

deleteSnapshot() public method

Delete a snapshot.
public deleteSnapshot ( string $repository, string $name ) : Response
$repository string the repository in which the snapshot resides
$name string the name of the snapshot to be deleted
return Response

getAllRepositories() public method

Retrieve all repository records.
public getAllRepositories ( ) : array
return array

getAllSnapshots() public method

Retrieve data regarding all snapshots in the given repository.
public getAllSnapshots ( string $repository ) : array
$repository string the repository name
return array

getRepository() public method

Retrieve a repository record by name.
public getRepository ( string $name ) : array
$name string the name of the desired repository
return array

getSnapshot() public method

Retrieve data regarding a specific snapshot.
public getSnapshot ( string $repository, string $name ) : array
$repository string the name of the repository from which to retrieve the snapshot
$name string the name of the desired snapshot
return array

registerRepository() public method

Register a snapshot repository.
public registerRepository ( string $name, string $type, array $settings = [] ) : Response
$name string the name of the repository
$type string the repository type ("fs" for file system)
$settings array Additional repository settings. If type "fs" is used, the "location" setting must be provided.
return Response

request() public method

Perform a snapshot request.
public request ( string $path, string $method = Request::GET, array $data = [], array $query = [] ) : Response
$path string the URL
$method string the HTTP method
$data array request body data
$query array query string parameters
return Response

restoreSnapshot() public method

Restore a snapshot.
public restoreSnapshot ( string $repository, string $name, array $options = [], boolean $waitForCompletion = false ) : Response
$repository string the name of the repository
$name string the name of the snapshot
$options array options for the restore operation
$waitForCompletion boolean if true, the request will not return until the restore operation is complete
return Response

Property Details

$_client protected property

protected Client,elastica $_client
return Client