Ejemplo n.º 1
0
<?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}');
Ejemplo n.º 2
0
<?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();
Ejemplo n.º 3
0
<?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}']);
Ejemplo n.º 4
0
<?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}']);
Ejemplo n.º 5
0
<?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);
Ejemplo n.º 6
0
<?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();
Ejemplo n.º 7
0
<?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();
Ejemplo n.º 8
0
<?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}');
Ejemplo n.º 9
0
<?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}']);
Ejemplo n.º 10
0
<?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);
Ejemplo n.º 11
0
<?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();
Ejemplo n.º 12
0
<?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}');