getAuthService( self::API_STORAGE_DISK); $rest->GET(); return $rest->getResultAsArray( models\Storage\StorageDisk::class); } /** * Get a given disk info * @param $diskId * @return \alphayax\freebox\api\v3\models\Storage\StorageDisk */ public function getFromId( $diskId){ $rest = $this->getAuthService( self::API_STORAGE_DISK . $diskId); $rest->GET(); return $rest->getResult( models\Storage\StorageDisk::class); } /** * Update a disk state * @param \alphayax\freebox\api\v3\models\Storage\StorageDisk $storageDisk * @return \alphayax\freebox\api\v3\models\Storage\StorageDisk */ public function update( models\Storage\StorageDisk $storageDisk){ $rest = $this->getAuthService( self::API_STORAGE_DISK . $storageDisk->getId()); $rest->PUT( $storageDisk); return $rest->getResult( models\Storage\StorageDisk::class); } /** * Format the disk with the given id * There will be one partition using all the available space on disk. All previous data will be lost. * Parameters will be ignored if you format the Freebox internal disk * @param \alphayax\freebox\api\v3\models\Storage\StorageDisk $storageDisk * @param string $label * @param string $fsType * @param string $tableType * @see symbols\Storage\DiskPartition\FsType * @see symbols\Storage\StorageDisk\TableType * @return bool */ public function format( models\Storage\StorageDisk $storageDisk, $label, $fsType, $tableType){ $rest = $this->getAuthService( self::API_STORAGE_DISK . $storageDisk->getId()); $rest->PUT([ 'label' => $label, 'fs_type' => $fsType, 'table_type' => $tableType, ]); return $rest->getSuccess(); } }