mirror of
https://github.com/pgsty/minio.git
synced 2026-09-09 20:14:04 +03:00
7a060cab1e
Keep NVMe/HDD pool pairs useful without remote tiering: promote objects that are read often, demote previously moved objects once they go idle, and leave the feature off until operators set a two-pool topology. Signed-off-by: mr javad seydi <seydi.birjand@gmail.com>
38 lines
992 B
Bash
Executable File
38 lines
992 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Install a lifecycle XML document without an SDK normalizing away Silo's
|
|
# AccessTransition and AccessTierQuota extension elements.
|
|
set -eu
|
|
|
|
if [ "$#" -ne 4 ]; then
|
|
echo "usage: AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... $0 ENDPOINT BUCKET REGION LIFECYCLE_XML" >&2
|
|
exit 2
|
|
fi
|
|
|
|
endpoint=$1
|
|
bucket=$2
|
|
region=$3
|
|
lifecycle_file=$4
|
|
|
|
: "$AWS_ACCESS_KEY_ID"
|
|
: "$AWS_SECRET_ACCESS_KEY"
|
|
|
|
if [ ! -r "$lifecycle_file" ]; then
|
|
echo "cannot read lifecycle document: $lifecycle_file" >&2
|
|
exit 2
|
|
fi
|
|
|
|
content_md5=$(openssl dgst -md5 -binary "$lifecycle_file" | openssl base64)
|
|
endpoint=$(printf '%s' "$endpoint" | sed 's:/*$::')
|
|
|
|
curl --fail-with-body --silent --show-error \
|
|
--request PUT \
|
|
--aws-sigv4 "aws:amz:$region:s3" \
|
|
--user "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" \
|
|
--header "Content-MD5: $content_md5" \
|
|
--header "Content-Type: application/xml" \
|
|
--data-binary "@$lifecycle_file" \
|
|
"$endpoint/$bucket?lifecycle"
|
|
|
|
echo "installed lifecycle configuration on $bucket"
|