<?php require 'vendor/autoload.php'; $openstack = new OpenStack\OpenStack(['authUrl' => '{authUrl}', 'region' => '{region}', 'user' => ['id' => '{userId}', 'password' => '{password}'], 'scope' => ['project' => ['id' => '{projectId}']]]); /** @var bool $exists */ $exists = $openstack->objectStoreV1()->getContainer('{containerName}')->objectExists('{objectName}');
<?php require 'vendor/autoload.php'; $openstack = new OpenStack\OpenStack(['authUrl' => '{authUrl}', 'region' => '{region}', 'user' => ['id' => '{userId}', 'password' => '{password}'], 'scope' => ['project' => ['id' => '{projectId}']]]); $openstack->objectStoreV1()->getContainer('{containerName}')->delete();
<?php require 'vendor/autoload.php'; $openstack = new OpenStack\OpenStack(['authUrl' => '{authUrl}', 'region' => '{region}', 'user' => ['id' => '{userId}', 'password' => '{password}'], 'scope' => ['project' => ['id' => '{projectId}']]]); $service = $openstack->objectStoreV1(); $account = $service->getAccount(); $account->resetMetadata(['{key_1}' => '{val_1}', '{key_2}' => '{val_2}']);
<?php require 'vendor/autoload.php'; $openstack = new OpenStack\OpenStack(['authUrl' => '{authUrl}', 'region' => '{region}', 'user' => ['id' => '{userId}', 'password' => '{password}'], 'scope' => ['project' => ['id' => '{projectId}']]]); $openstack->objectStoreV1()->getContainer('{containerName}')->getObject('{objectName}')->mergeMetadata(['{key_1}' => '{val_1}', '{key_2}' => '{val_2}']);
<?php require 'vendor/autoload.php'; $openstack = new OpenStack\OpenStack(['authUrl' => '{authUrl}', 'region' => '{region}', 'user' => ['id' => '{userId}', 'password' => '{password}'], 'scope' => ['project' => ['id' => '{projectId}']]]); $options = ['name' => '{objectName}', 'content' => '{objectContent}']; /** @var \OpenStack\ObjectStore\v1\Models\Object $object */ $object = $openstack->objectStoreV1()->getContainer('{containerName}')->createObject($options);
<?php require 'vendor/autoload.php'; $openstack = new OpenStack\OpenStack(['authUrl' => '{authUrl}', 'region' => '{region}', 'user' => ['id' => '{userId}', 'password' => '{password}'], 'scope' => ['project' => ['id' => '{projectId}']]]); /** @var \GuzzleHttp\Stream\Stream $stream */ $stream = $openstack->objectStoreV1()->getContainer('{containerName}')->getObject('{objectName}')->download();
<?php require 'vendor/autoload.php'; $openstack = new OpenStack\OpenStack(['authUrl' => '{authUrl}', 'region' => '{region}', 'user' => ['id' => '{userId}', 'password' => '{password}'], 'scope' => ['project' => ['id' => '{projectId}']]]); /** @var array $metadata */ $metadata = $openstack->objectStoreV1()->getContainer('{containerName}')->getMetadata();
<?php require 'vendor/autoload.php'; $openstack = new OpenStack\OpenStack(['authUrl' => '{authUrl}', 'region' => '{region}', 'user' => ['id' => '{userId}', 'password' => '{password}'], 'scope' => ['project' => ['id' => '{projectId}']]]); $container = $openstack->objectStoreV1()->getContainer('{containerName}');
<?php require 'vendor/autoload.php'; $openstack = new OpenStack\OpenStack(['authUrl' => '{authUrl}', 'region' => '{region}', 'user' => ['id' => '{userId}', 'password' => '{password}'], 'scope' => ['project' => ['id' => '{projectId}']]]); $openstack->objectStoreV1()->getContainer('{containerName}')->getObject('{objectName}')->copy(['destination' => '{newContainerName}/{newObjectName}']);
<?php require 'vendor/autoload.php'; use Guzzle\Stream\Stream; $openstack = new OpenStack\OpenStack(['authUrl' => '{authUrl}', 'region' => '{region}', 'user' => ['id' => '{userId}', 'password' => '{password}'], 'scope' => ['project' => ['id' => '{projectId}']]]); $options = ['name' => 'object_name.txt', 'stream' => new Stream(fopen('/path/to/large_object.mov', 'r'))]; // optional: specify the size of each segment in bytes $options['segmentSize'] = 1073741824; // optional: specify the container where the segments live. This does not necessarily have to be the // same as the container which holds the manifest file $options['segmentContainer'] = 'test_segments'; /** @var \OpenStack\ObjectStore\v1\Models\Object $object */ $object = $openstack->objectStoreV1()->getContainer('test')->createLargeObject($options);
<?php require 'vendor/autoload.php'; $openstack = new OpenStack\OpenStack(['authUrl' => '{authUrl}', 'region' => '{region}', 'user' => ['id' => '{userId}', 'password' => '{password}'], 'scope' => ['project' => ['id' => '{projectId}']]]); $account = $openstack->objectStoreV1()->getAccount();
<?php require 'vendor/autoload.php'; $openstack = new OpenStack\OpenStack(['authUrl' => '{authUrl}', 'region' => '{region}', 'user' => ['id' => '{userId}', 'password' => '{password}'], 'scope' => ['project' => ['id' => '{projectId}']]]); /** @var \OpenStack\ObjectStore\v1\Models\Object $object */ $object = $openstack->objectStoreV1()->getContainer('{containerName}')->getObject('{objectName}');