Exemplo 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}');
Exemplo 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();
Exemplo 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}']);
Exemplo 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}']);
Exemplo 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);
Exemplo 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();
Exemplo 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();
Exemplo 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}');
Exemplo 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}']);
Exemplo 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);
Exemplo 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();
Exemplo 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}');