Manage Objects
Following the steps in the current example, you list all buckets that you own, create a bucket, upload an object to it, and add tags to the object.
Procedure
-
List all buckets owned by the
authenticated user.
GET https://vcloud-object-storage.example.com:8443/api/v1/s3
The response body contains a list of all buckets that the authenticated user owns. -
Create a bucket.
PUT https://vcloud-object-storage.example.com:8443/api/v1/s3/bucket-name
For more information, see https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html.The system returns a 200 OK message upon a successful creation of the bucket. -
Verify that the bucket is
available and accessible.
HEAD https://vcloud-object-storage.example.com:8443/api/v1/s3/bucket-name
If the bucket is available and accessible for the authenticated user, the system returns a 200 OK message. -
Upload an object.
PUT https://vcloud-object-storage.example.com:8443/api/v1/s3/bucket-name/object-name
For more information, see https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html. -
Add tags to the object.
Object tags are a key-value pairs that help you categorize objects and buckets.
PUT https://vcloud-object-storage.example.com:8443/api/v1/s3/bucket-name/object-name?tagging
Following is an example of a valid tagging request body in JSON and XML formats:{ "tagSets": [ { "tags": [ { "key": "string", "value": "string" } ] } ] }
<Tagging> <TagSet> <Tag> <Key>string</Key> <Value>string</Value> </Tag> </TagSet> </Tagging>
For more information, see https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html.The system returns a 200 OK message upon a successful completion of the operation.