Jak se připojit ke cloudovému úložišti: informace pro vývojáře

Jak se připojit ke cloudovému úložišti: informace pro vývojáře

Odkazy SDK:

Příklad instalace SDK s použitím PHP composer:

cd public_html/
curl -sS https://getcomposer.org/installer | php
vi composer.json
{
	"require": {
		"php": "7.0.*",
		"php-opencloud/openstack": "^3.0",
		"aws/aws-sdk-php": "2.*"
	}
}

composer.phar install

Příklad použití Swift SDK, Keystone (Identity) V3:

swift.php
'https://storage-eu.eudc.cloud/v3',
'region' => 'RegionOne',
'user' => [
	'name' => 'your username',
	'password' => 'your password',
	'domain' => ['id' => 'default' ]
],
'scope' => [
	'project' => [
		'name' => 'your project name',
		'domain' => ['id' => 'default']
		]
	]
]
);

$identity = $openstack->identityV3();
$service = $openstack->objectStoreV1();

Příklad použití S3 Compatible:

s3.php
'your key',
'secret' => 'your secret',
'endpoint' => 'https://storage-eu.eudc.cloud',
'signature_version' => 'v2',
)
);

//Listing all S3 Bucket
$result = $client->listBuckets();
print_r($result);

// Create s3 bucket
$result = $client->createBucket(array('Bucket' => "ContainerName/"));
print_r($result);

// Upload file to s3 bucket
$body=file_get_contents("Filename");

Máte-li jakékoli dotazy, prosíme, kontaktujte technickou podporu na adrese: support@host-telecom.com

Zpráva o pravopisné chybě

Následující text bude zaslán naší redakci: