For your first question:
Take a look the following link:
Constraints
For the second question:
Doing a little research in Object Storage API v1 (SUPPORTED), I didn't find any way to get the folder's size. Also the Portal doesn't display the folder size neither.
A workaround would be to get all the file's sizes inside the folder using SoftLayer Object Storage PHP Client](https://github.com/softlayer/softlayer-object-storage-php)
Updated
PHP Script to get folder size
/**
* This method retrieves folder size
* @var $containerName - The container's name where the folder is located
* @var $folder - The folder that you wish to retrieve its size
*/
function getFolderSize($objectStorage, $containerName, $folder) {
// Get objects
$objects = $objectStorage -> with($containerName . "/") -> get() -> objects;
$size = 0;
foreach ($objects as $object) {
$objectName = explode($containerName . "/", $object -> getPath());
$folderName = explode($folder . "/", $objectName[1]);
if (sizeof($folderName) > 1) {
$sizeObject = $objectStorage -> with($containerName . "/" . $folder . "/" . $folderName[1]) -> get() -> getHeader('Content-length');
$size = $size + $sizeObject;
//print_r("\n File" . $folderName[1] . " " . $sizeObject . " Bytes (" . ($sizeObject / 1024) . " KB) Total Size Folder: " . $size . " Bytes (" . ($size / 1024) . " KB)");
}
}
return $size;
}
/**
* Declare Object Storage parameters
*/
$host = 'https://mil01.objectstorage.softlayer.net/auth/v1.0/';
// the SoftLayer Object Storage API host
$username = 'set me';
$password = 'set me';
$options = array('adapter' => ObjectStorage_Http_Client::SOCKET, 'timeout' => 10);
/**
* Creating Object Storage Object
*/
$objectStorage = new ObjectStorage($host, $username, $password, $options);
/**
* Retrieve a folder's size
*/
$size = getFolderSize($objectStorage, "rcvTest", "folderTest/folder1/subfolder1/subsubfolder1");
print_r("\n Folde Size: " . $size . " bytes " . $size / 1024 . " KB");
References:
SoftLayer Object Storage PHP Client