Base
| Function | Description |
|---|---|
s3::get() |
Returns the contents of the specified object |
s3::put() |
Uploads content to the specified object |
s3::delete() |
Deletes the specified object |
s3::get
Section titled “s3::get”The s3::get function retrieves the contents of key from bucket via an S3 GET request.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
bucket |
String | The S3 bucket to read from |
key |
String | The key of the object to retrieve |
Returns
Section titled “Returns”| Type | Description |
|---|---|
| Bytes | The contents of object |
Example
Section titled “Example”<string> s3::get('main', 'hello.txt');Returns 'Hello World!'
Errors
Section titled “Errors”s3::get fails the query under the following conditions:
The specified bucket does not existThe specified key does not exist
Any other error indicates a misconfigured bucket (credentials, permissions) or module, and is reported as raised by the underlying S3/AWS SDK or HTTP client.
s3::put
Section titled “s3::put”The s3::put function uploads content to key in bucket via an S3 PUT request.
If key already exists, its content is replaced.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
bucket |
String | The S3 bucket to write to |
key |
String | The key of the object to write |
content |
Bytes | The content to upload |
Returns
Section titled “Returns”| Type | Description |
|---|---|
| NONE | Returned once the upload succeeds |
Example
Section titled “Example”s3::put('main', 'hello.txt', <bytes>'Hello World!');Returns NONE
Errors
Section titled “Errors”s3::put fails the query under the following conditions:
The specified bucket does not exist
Any other error indicates a misconfigured bucket (credentials, permissions) or module, and is reported as raised by the underlying S3/AWS SDK or HTTP client.
s3::delete
Section titled “s3::delete”The s3::delete function deletes key from bucket via an S3 DELETE request.
Succeeds even if key does not exist.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
bucket |
String | The S3 bucket to delete from |
key |
String | The key of the object to delete |
Returns
Section titled “Returns”| Type | Description |
|---|---|
| NONE | Returned once the object is deleted |
Example
Section titled “Example”s3::delete('main', 'hello.txt');Returns NONE
Errors
Section titled “Errors”s3::delete fails the query under the following conditions:
The specified bucket does not exist
Any other error indicates a misconfigured bucket (credentials, permissions) or module, and is reported as raised by the underlying S3/AWS SDK or HTTP client.