src/Api/Volume.php
public function snapshot($id, $name)
    {
        $data = [
            'name' => $name,
        ];

        $snapshot = $this->adapter->post(sprintf('%s/volumes/%s/snapshots', $this->endpoint, $id), $data);

        $snapshot = json_decode($snapshot);

        return new SnapshotEntity($snapshot->snapshot);
    }
public function snapshot($id, $name)
    {
        $data = [
            'name' => $name,
        ];

        $snapshot = $this->adapter->post(sprintf('%s/volumes/%s/snapshots', $this->endpoint, $id), $data);

        $snapshot = json_decode($snapshot);

        return new SnapshotEntity($snapshot->snapshot);
    }
public function snapshot ( $ id , $ name ) { $ data = [ 'name' => $ name , ] ; $ snapshot = $ this -> adapter -> post ( sprintf ( '%s/volumes/%s/snapshots' , $ this -> endpoint , $ id ) , $ data ) ; $ snapshot = json_decode ( $ snapshot ) ; return new SnapshotEntity ( $ snapshot -> snapshot ) ; }
Create a new snapshot of the volume.

@param string $id   the id of the volume
@param string $name a human-readable name for the volume snapshot

@throws HttpException

@return SnapshotEntity
Create a new snapshot of the volume .