⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
rgw
All Projects
Ceph
»
rgw
Overview
Activity
Roadmap
Issues
Spent time
Gantt
Download (1.03 KB)
Bug #38758
» rgw_lifecycle_prefix_reproducer.php
php reproducer -
Konstantin Shalygin
, 03/15/2019 09:19 AM
<?php
# https://github.com/aws/aws-sdk-php
require
'aws-sdk/aws-autoloader.php'
;
use
Aws\S3\S3Client
as
S3Client
;
use
Aws\S3\Exception\S3Exception
as
S3Exception
;
function
main
()
{
$s3
=
new
S3Client
([
'region'
=>
'us-east-1'
,
'version'
=>
'latest'
,
'endpoint'
=>
'https://rgw_civetweb'
,
'use_path_style_endpoint'
=>
true
,
'signature_version'
=>
'v4'
,
'credentials'
=>
[
'key'
=>
'abc'
,
'secret'
=>
'xyz'
,
],
]);
$s3_bucket
=
"bucket"
;
try
{
$s3_set_bucket_lifecycle
=
$s3
->
putBucketLifecycleConfiguration
([
"Bucket"
=>
$s3_bucket
,
"LifecycleConfiguration"
=>
[
"Rules"
=>
[
[
"Expiration"
=>
[
"Days"
=>
2
],
"Status"
=>
"Enabled"
],
],
],
]);
}
catch
(
S3Exception
$e
)
{
echo
(
"Code: "
.
$e
->
getStatusCode
()
.
"
\n
Error: "
.
$e
->
getAwsErrorCode
());
}
}
main
()
?>
« Previous
1
2
3
4
Next »
(3-3/4)
Loading...