...
Hilfe: https://devops.ionos.com/api/s3/
Anlegen eines Buckets mit object lock:
Linux
Codeblock |
---|
alias awslocal='aws --endpoint-url https://s3-eu-central-1.ionoscloud.com'
awslocal s3api create-bucket --bucket test-with-worm --object-lock-enabled-for-bucket
awslocal s3api put-object-lock-configuration \
--bucket test-with-worm \
--object-lock-configuration '{ "ObjectLockEnabled": "Enabled", "Rule": {
"DefaultRetention": { "Mode": "COMPLIANCE", "Days": 10 }}}'
awslocal s3api get-object-lock-configuration --bucket test-with-worm
awslocal s3api put-object --bucket test-with-worm --key test.txt --body test.txt
awslocal s3api get-object-retention --bucket test-with-worm --key test.txt |
Windows
Codeblock |
---|
# create bucket with objectlock
aws --endpoint-url https://s3-eu-central-1.ionoscloud.com s3api create-bucket --bucket newbucketname --object-lock-enabled-for-bucket
# set object lock properties
aws --endpoint-url https://s3-eu-central-1.ionoscloud.com s3api put-object-lock-configuration --bucket newbucketname --object-lock-configuration '{ \"ObjectLockEnabled\": \"Enabled\", \"Rule\": { \"DefaultRetention\": { \"Mode\": \"COMPLIANCE\", \"Days\": 10 }}}'
# check configuration
aws --endpoint-url https://s3-eu-central-1.ionoscloud.com s3api get-object-lock-configuration --bucket newbucketname
# put testfile.txt (from local working directory) into bucket
aws --endpoint-url https://s3-eu-central-1.ionoscloud.com s3api put-object --bucket newbucketname --key testfile.txt --body testfile.txt
# check properties of object "testfile.txt"
aws --endpoint-url https://s3-eu-central-1.ionoscloud.com s3api get-object-retention --bucket newbucketname --key testfile.txt |
S3 kompatiblen Storage bei Wasabi
...