Was this content helpful?
How could we make this article more helpful?
S3 API has emerged as the dominant API for storing large amounts of unstructured data. Lyve Cloud Object Storage supports the standard S3 RESTful API. The full API guide is available at:
https://<resellername>.rstorcloud.io/apidoc/index.html#introduction
If you are a non-admin user, sign in as a customer using the following URL:
https://<reseller-name>.lyve.seagate.com/signin
where <reseller-name> is the reseller account name.
If you are an admin, sign in as a reseller.
Customers may access their buckets through a DNS-style or Virtual-Host convention:
Where <endpoint> is:
To access the subaccount of a Reseller, use the following URL: https://<reseller-name>.lyve.seagate.com/signin.
Once logged in, the account page gives access to options such as configuring multifactor authentication, changing the account password, and generating access keys.
To create a bucket:
The format for creating a public bucket is:
https://<bucketname>.<endpoint>.<path>
where there is case sensitivity in the letters.
Lyve Cloud leverages the concept of buckets: each bucket is a container for objects. All new buckets are private by default. A bucket can be made public by applying the following policy to it:
{
"Version": "2019-10-17",
"Statement": [
{
"Action": ["s3:GetBucketLocation"], "Effect": "Allow",
"Principal": { "AWS": ["*"] },
"Resource": ["arn:aws:s3:::BUCKETNAME"], "Sid": ""
},
{
"Action": ["s3:GetObject"], "Effect": "Allow", "Principal": { "AWS": ["*"] },
"Resource": ["arn:aws:s3:::BUCKETNAME/*"], "Sid": ""
}
]
}
The policy can be deleted any time with a DELETE /bucketname/?policy request to make the bucket private again.
Bucket policy can also be managed from the web GUI using a simple point-and-click web interface.
To delete a bucket, you typically empty all of its objects and folders and delete all of its associated policies. Lyve Cloud offers a 'SuperDelete' feature that deletes the bucket and its entire contents for you at once.
To use either delete method:
The web GUI has a feature to upload files into Lyve Cloud. There are two methods to upload files:
Using the drag and drop method:
Using the upload method:
Objects can be shared with a pre-signed URL. To share an object from the web GUI, select a folder and object you would like to share with anyone.
As a subaccount under a reseller, you can grant users access to your buckets. They have the following permissions: policies, buckets, and adding more users.
To create a new user:
To create policies in your Lyve Cloud bucket:
Use the menu at any time to change the permissions granted to the bucket.
It's important to note the following about access keys:
To create the credentials for the account:
To install AWS CLI, refer to Amazon’s guide: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html.
aws configure and set up the AWS command line. To begin initial installation, both access keys and secret keys are needed.
aws iam create-access-key --endpoint-url https://iam.lyve.seagate.com
A new key pair is generated.
Multifactor authentication (MFA) is a security system that requires more than one method of authentication from independent categories of credentials to verify the user’s identity for a login or other transaction.
To begin set up for multifactor authentication:
Once setup is completed, a number of recovery keys will be given in case you lose access to your MFA device. Make sure to copy the recovery codes and store them in a safe place. This will be the only way to recover your locked account.
import hashlib
import os
import sys
with open(sys.argv[1], 'rb') as f1:
file_1 = f1.read()
with open(sys.argv[2], 'rb') as f2:
file_2 = f2.read()
sha_1 = hashlib.sha256(file_1).hexdigest()
sha_2 = hashlib.sha256(file_2).hexdigest()
print("SHA256 of file 1: {0}".format(sha_1))
print("SHA256 of file 2: {0}".format(sha_2))
print("SHA256 of file 1 == SHA256 of file 2 returns {0}".format(sha_1==sha_2))
exit()
Sample output for script:

Lyve Cloud offers multi-site replication to add redundancy to your dataset locality.
To test Lyve Cloud multi-site redundancy:
<region-name>.<customername>.lyve.seagate.com instead of <endpoint_name>.lyve.seagate.com as the endpoint. <region-name> can be: sjc03, dca02, den02. Replace <customer-name> with your customer name.
Lyve Cloud enforces encryption of data in flight using Transport Layer Security (TLS), a widely adopted security protocol designed to facilitate privacy and data security for communications over the Internet. It's used to establish encrypted links between a web server and a browser, protecting the data exchanged between them.
Lyve Cloud supports server-side encryption with customer-provided keys—the user manages the encryption keys and Lyve Cloud manages the encryption, as it writes to disks, and decryption, when accessing objects.
Note the following:
When data from multiple places collects in one bucket, it is called data at rest. Lyve Cloud currently supports Data At Rest Encryption, or DARE.
See the following AWS documentation:
x-amz-server-side -encryption -customer-algorithm: AFDLKSJFJK x-amz-server-side -encryption -customer-key: AKFLJDKLF x-amz-server-side -encryption -customer-key-MD5: XAKFHLD
An example request for putting a file into Lyve Cloud would look something like this:
aws s3api put-object --bucket demo-sse --key "keyname" \ --body example.txt \ --sse-customer-algorithm "AES256" \ --sse-customer-key \ --sse-customer-key-md5 \ --profile \ --endpoint-url "https://.lyve.seagate.com)“
A policy can be used to enforce all objects that are uploaded to a bucket, “mybucketname”, to be server-side encrypted with AES256. See Create Policies for more information.
$ awscurl --access-key XXX --secret-key YYY --service s3 https://.lyve.seagate.com/mybucketname/?policy -X PUT -H "Content-Type: application/json" --data "
{
"Version": "2012-10-17",
"Id": "PutObjPolicy", "Statement": [
{
"Sid": "DenyIncorrectEncryptionHeader", "Effect": "Deny",
"Principal": "*", "Action": "s3:PutObject",
"Resource": "arn:aws:s3:::mybucketname/*", "Condition": {
"StringNotEquals": {
"s3:x-amz-server-side-encryption": "AES256"
}
}
},
{
"Sid": "DenyUnEncryptedObjectUploads", "Effect": "Deny",
"Principal": "*", "Action": "s3:PutObject",
"Resource": "arn:aws:s3:::mybucketname/*", "Condition": {
"Null": {
"s3:x-amz-server-side-encryption": true
}
}
}
]
}"
To remove the aforementioned policy:
awscurl --access-key XXX --secret-key YYY --service s3 https://.lyve.seagate.com/mybucketname/?policy -X DELETE
Lyve Cloud supports Write Once Read Many (WORM) objects. A user can use this feature to prevent an object from getting overwritten for a period of time or indefinitely. Object locking can also be used for a legal hold. A legal hold is the same as a retention period, but it has no expiration date. Instead, a legal hold remains in place until you explicitly remove it. To use this feature, you must create a bucket with object lock configuration using the AWS CLI. Enabling object locking on an existing bucket is possible. It also enables versioning.
aws s3api create-bucket --bucket demo-lock --object-lock-enabled-for- bucket --endpoint-url https://demo.lyve.seagate.com --profile local
aws s3api put-object --bucket demo-lock --key "divina" --body ~/divina_commedia.txt --endpoint-url https://demo.lyve.seagate.com -- profile local
{
"ETag": "\"d43dc972416413a6114fbe4321ee1979\"",
"VersionId": "01DXHDYQ6Q7J0VGXPETMQY8W0Y-v"
}
aws s3api put-object-legal-hold --bucket demo-lock --key divina -- legal-hold "Status=ON" --endpoint-url https://demo.lyve.seagate.com -- profile local
aws s3api put-object-legal-hold --bucket demo-lock --key divina -- version-id "01DXHDYQ6Q7J0VGXPETMQY8W0Y-v" --legal-hold "Status=OFF" --endpoint-url https://demo.lyve.seagate.com --profile local
aws s3api delete-object --bucket demo-lock --key divina --version-id "01DXHDYQ6Q7J0VGXPETMQY8W0Y-v" --endpoint-url https://demo.lyve.seagate.com --profile local
{
"VersionId": "01DXHDYQ6Q7J0VGXPETMQY8W0Y-v"
}
aws s3api list-object-versions --bucket demo-lock --prefix divina -- endpoint-url https://demo.lyve.seagate.com --profile local
{
"DeleteMarkers": [
{
"Owner": {
"ID": "100000000001"
},
"Key": "divina",
"VersionId": "01DXHE1AW5HYQQ3DH24Q13Z1TM-v",
"IsLatest": true,
"LastModified": "2020-01-01T20:51:28.7730474Z"
}
]
}
aws s3api put-object --bucket demo-lock --key divina-sec --body ~/divina_commedia.txt --endpoint-url https://demo.lyve.seagate.com -profile local
{
"ETag": "\"d43dc972416413a6114fbe4321ee1979\"",
"VersionId": "01DXHEMXSDT3GB8Y9Y6DENXX0Q-v"
}
aws s3api put-object-retention --bucket demo-lock --key divina-sec -retention="Mode=GOVERNANCE,RetainUntilDate=2020-01- 15T00:00:00.000Z" --endpoint-url https://demo.lyve.seagate.com --profile local
aws s3api get-object-retention --bucket demo-lock --key divina-sec -endpoint-url https://demo.lyve.seagate.com --profile local
{
"Retention": { "Mode": "GOVERNANCE",
"RetainUntilDate": "2020-01-15T00:00:00Z"
}
}
Bucket logging is a feature that provides the ability to log access of a bucket for statistical or audit purposes. It also provides a mechanism to optionally store logs in a bucket other than the one being monitored.
Note the following:
There are two methods to establish this feature:
Bucket activities will be uploaded every 15 minutes in the destination bucket in a file formatted like this one:
bucket_logging_example_testlog_2020_02_12_20:28:08_819361559
Example:
bucket_logging.json
{
"LoggingEnabled": {
"TargetBucket": "bucketlogs",
"TargetPrefix": "logs/",
"TargetGrants": [
{"Grantee": { "ID": "LYVE_KEY_123", "Type": "AccessKey"}}
]
}
}
In order to activate the logging on a given bucket with success, the following is required:
Example command:
aws s3api put-bucket-logging --bucket testbucket --bucket-logging- status file:///user/test/bucket_logging.json --endpoint-url "https://demo.lyve.seagate.com"
In order to remove a Bucket Logging configuration for a specific bucket, perform a PUT giving an empty BucketLoggingStatus request. For example, you could create a disable.json with the following:
{
}
aws s3api put-bucket-logging --bucket testbucket --bucket-logging- status file:///user/test/ disable.json --endpoint-url "https://demo.lyve.seagate.com"
To retrieve a bucket logging configuration for a bucket:
aws s3api get-bucket-logging --bucket testlog --endpoint- url https://demo.lyve.seagate.com
This will look similar to:
<?xml version="1.0" encoding="UTF-8"?> <bucketloggingstatus> <loggingenabled> <targetbucket>targetlog</targetbucket> <targetprefix>logs/</targetprefix> <targetgrants> <grant> <grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance" xsi:type="AccessKey"> <ID>LYVE_KEY_123</ID> </Grantee> </Grant> </TargetGrants> </LoggingEnabled> </BucketLoggingStatus>
| Term | Description |
|---|---|
| BucketOwner | The owner ID of the monitored bucket. |
| Bucket | The monitored bucket. |
| TS | The timestamp of the action [06/Feb/2019:00:00:38 +0000]. |
| RemoteIp | The apparent IP of the requester. Intermediate proxies and firewalls might obscure the actual address of the machine making the request. |
| Requester | The AccessKey used to perform the action. |
| RequestId | The Request ID. |
| Operation | The kind of operation (example: s3.PutObject, s3.GetObject). |
| Key | The object Key (if present). |
| RequestUri | The Request-URI part of the HTTP request message. |
| HttpStatus | The numeric HTTP status code of the response. |
| ErrorCode | The S3 Error Code. A hyphen (-) character is displayed if no error occurred. |
| BytesSent | The transferred bytes. |
| ObjectSize | The size of the object transferred. |
| TotalTime | The number of milliseconds the request was in flight from the server's perspective. |
| TurnAroundTime | The number of milliseconds spent processing the request. |
| Referer | The value of the HTTP Referer header (if present). |
| UserAgent | The value of the HTTP User-Agent header. |
| VersionId | The version ID in the request (if present). |
| HostId | Not used. A hyphen (-) character is displayed. |
| SignatureVersion | The signature version ('SigV2' or 'SigV4') that was used to authenticate the request. A hyphen (-) is displayed in the other case. |
| Auth | The type of request authentication used: 'AuthHeader' for authentication headers, 'QueryString' or a hyphen (-) for other cases. |
| HostHeader | Not used. A hyphen (-) character is displayed. |
| TLSVer | The TLS version used. |
100000000001 testlog [12/Feb/2020:20:28:02 +0100] "[::1]:34178" "LYVE_KEY_123" "qfqun6v6dido" s3:PutObject "testkey" "/testlog/testkey" "200" "-" 125829120 "0" 279 274 "" "aws-sdk-go/1.28.13 (go1.13.7; linux; amd64)" 01E0XDYR0H0DA24AYE1DV1PK5S - SigV4 SSL AuthHeader - "-" 100000000001 testlog [12/Feb/2020:20:28:02 +0100] "[::1]:34178" "LYVE_KEY_123" "50gzg1qj4ftt" s3:HeadObject "testkey" "/testlog/testkey" "200" "-" 125829120 125829120 1 0 "" "aws-sdk- go/1.28.13 (go1.13.7; linux; amd64)" 01E0XDYR0H0DA24AYE1DV1PK5S - SigV4 SSL AuthHeader - "-" 100000000001 testlog [12/Feb/2020:20:28:02 +0100] "[::1]:34178" "LYVE_KEY_123" "eybjzx8hvf5s" s3:DeleteObject "testkey" "/testlog/testkey" "200" "-" "0" "0" 2 0 "" "aws-sdk-go/1.28.13 (go1.13.7; linux; amd64)" "-" - SigV4 SSL AuthHeader - "-" 100000000001 testlog [12/Feb/2020:20:28:02 +0100] "[::1]:34178" "LYVE_KEY_123" "69srbt1hije2" s3:PutObject "foo" "/testlog/foo" "200" "-" 20 "0" 3 1 "" "aws-sdk-go/1.28.13 (go1.13.7; linux; amd64)" 01E0XDYR0TABEJXCHQ300Z8BHE - SigV4 SSL AuthHeader - "-" 100000000001 testlog [12/Feb/2020:20:28:02 +0100] "[::1]:34178" "LYVE_KEY_123" "misyyofy69qw" s3:HeadObject "foo" "/testlog/foo" "200" "-" 20 20 1 0 "" "aws-sdk-go/1.28.13 (go1.13.7; linux; amd64)" 01E0XDYR0TABEJXCHQ300Z8BHE - SigV4 SSL AuthHeader - "-" 100000000001 testlog [12/Feb/2020:20:28:02 +0100] "[::1]:34178" "LYVE_KEY_123" "7lkfytqs6d7x" s3:DeleteObject "foo" "/testlog/foo" "200" "-" "0" "0" 2 0 "" "aws-sdk-go/1.28.13 (go1.13.7; linux; amd64)" "-" - SigV4 SSL AuthHeader - "-"
| Status | When the logging status is disabled, all form fields are disabled, too. When changing the status from 'Enabled' to 'Disabled', current values are still saved in the form until submission. Submitting a form with the status 'Disabled' will delete the bucket logging configuration and all data in the form will be lost. |
| Grantee | The form has a dropdown menu to select AccessKeyIDs associated with the current user and will autocomplete using the prefix substring currently in the text input. If the desired AccessKeyID does not appear in the list, any arbitrary string (for example, AccessKeyIDs managed by other users) is a valid input. AccessKeyIDs must be alphanumeric and contain precisely 26 characters. |
| Saving Logs | You must select a bucket from the dropdown menu. It will display all buckets the current user can access. |
| Log Prefix | Log prefixes are optional. By default, it will save log files in the bucket without a prefix. Prefix strings must end with forward slash (/). |
Lyve Cloud has the ability to have custom metadata applied to objects. Here is an example of applying metadata with the API and commonly used AWS CLI tool.
aws --profile=local --endpoint="http://demo.lyve.seagate.com" s3 cp octocats/original.png s3://testbucket/ --metadata Test=Pluto
To retrieve the object with the custom metadata:
% aws --profile=local --endpoint="https://demo.lyve.seagate.com" s3api head-object --bucket=testbucket --key=original.png
{
"AcceptRanges": "bytes",
"LastModified": "Mon, 23 Mar 2020 19:42:16 GMT",
"ContentLength": 50758,
"ETag": "\"2ec6d2a9d4888c31c5ae802e8cc9efd6\"",
"VersionId": "01E44ENHPQKG54VAFC8FB2RR10",
"ContentType": "image/png",
"Metadata": {
"test": "Pluto"
}
}
Lyve Cloud supports reading with Byte Range and updating using MultiPart upload copy. The next few sections display an example for each.
[testing@vbook:~]
% aws --profile pre --endpoint https://demo.lyve.seagate.com' s3api get-object --bucket simplebucket-testing --key='poignant.txt' 'poignant2.txt' --range bytes=0-500
{
"AcceptRanges": "bytes",
"LastModified": "Mon, 30 Mar 2020 18:59:08 GMT",
"ContentLength": 501,
"ETag": "\"2909cf38d280b0d88586740cd86e45e6\"", "VersionId": "01E4PCZK3W672JT0X74WK4BAHR",
"ContentRange": "bytes 0-500/1476", "Metadata": {}
}
[testing@vbook:~]
% cat poignant2.txt
Pretend that you've opened this book (although you probably have opened this book), just to find a huge onion right in the middle crease of the book. (The manufacturer of the book has included the onion at my request.) So you're like, "Wow, this book comes with an onion!" (Even if you don't particularly like onions, I'm sure you can appreciate the logistics of shipping any sort of produce discreetly inside of an alleged programming manual.) Then you ask yourself, "Wait a minute. I
Partially updating an object can be very useful in cases where a full object updated is not desired, such as with large objects. While the standard S3 protocol does not offer a byte-range update, there are a few use cases for updating an object with Multipart copy. Once a file has been written, it cannot be modified, only overwritten (as a whole) with a newer version.
The closest behavior to an object update can be produced by using the UploadPartCopy API to create a new version of the file, starting from the old file and from the changed parts. Note that this still triggers a full copy of the file.
aws s3 cp command does that does that in some cases.)To clarify, you cannot change a part in a file that is already in S3, but you can create a new file (using multipart uploads), and tell the server you want to use some range of the old file as a "part" instead of uploading from your computer. Having immutable versions helps greatly when replicating a file as there is no risk of conflicts between the same file on two datacenters, or replicating an older version over a newer one, or the client reading a partially updated version. This is an example using multipart upload:
% aws --profile pre --endpoint 'https://demo.lyve.seagate.com' s3api create-multipart-upload --bucket simplebucket-testing --key='some-multipart-upload'
{
"Bucket": "simplebucket-testing",
"Key": "some-multipart-upload",
"UploadId": "7xDckkL3iSJAvFBvZw5GmJWKkjfCxFXE3tAPalCVHOQZhaESNu"
}%
aws --profile pre --endpoint 'https://demo.lyve.seagate.com' s3api upload-part --bucket simplebucket-testing --key='some-multipart-upload' --upload-id 7xDckkL3iSJAvFBvZw5GmJWKkjfCxFXE3tAPalCVHOQZhaESNu --part-number 1 --body ~/Downloads/poignant-guide.pdf
{
"ETag": "\"61062673c8b37d22354523849923bbd2\""
}%
aws --profile pre --endpoint 'https://demo.lyve.seagate.com' s3api upload-part --bucket simplebucket-testing --key='some-multipart-upload' --upload-id 7xDckkL3iSJAvFBvZw5GmJWKkjfCxFXE3tAPalCVHOQZhaESNu --part-number 2 --body ~/Downloads/poignant-guide.pdf
{
"ETag": "\"61062673c8b37d22354523849923bbd2\""
}%
aws --profile pre --endpoint 'https://demo.lyve.seagate.com' s3api complete-multipart-upload --bucket simplebucket-testing --key='some-multipart-upload' --upload-id 7xDckkL3iSJAvFBvZw5GmJWKkjfCxFXE3tAPalCVHOQZhaESNu --multipart-upload 'Parts=[{ETag="\"61062673c8b37d22354523849923bbd2\"",PartNumber=1},{ETag="\"61062673c8b37d22354523849923bbd2\"",PartNumber=2}]'
{
"VersionId": "01E4PDSTT5DBJC5CFE57CTYG7E",
"Location": "",
"Bucket": "simplebucket-testing", "Key": "some-multipart-upload",
"ETag": "\"05c7f4ca2b92bedafcab99a3094c435b-2\""
}
RProtect is a feature that enables more-granular whitelisting to resources for both Reseller and Customer users. RProtect can explicitly ensure that only select IP addresses (or a range of IP addresses) can access a specific resource.
The RProtect feature may be enabled for a Reseller or fully disabled, meaning that anyone can access the buckets within the accounts. This feature is listed in the main menu bar as well as being available via the Lyve Cloud API.