π Quickstart
Three steps to start uploading files to Petadata Storage with your favorite SDK.
- Create an access key (Access Key + Secret) in the customer panel under Keys.
- Point your S3 client to https://s3.petadata.com.br:2222 with region us-east-1.
- Use S3 operations as usual. List, upload, download, delete, multipart, presigned URLs, all compatible.
import boto3
from botocore.config import Config
s3 = boto3.client(
's3',
endpoint_url='https://s3.petadata.com.br:2222',
aws_access_key_id='SUA_ACCESS_KEY',
aws_secret_access_key='SUA_SECRET_KEY',
region_name='us-east-1',
config=Config(s3={'addressing_style': 'path'}),
)
for b in s3.list_buckets()['Buckets']: # lista buckets
print(b['Name'])
s3.upload_file('photo.jpg', 'meu-bucket', 'fotos/photo.jpg') # upload
s3.download_file('meu-bucket', 'fotos/photo.jpg', 'local.jpg') # download
s3.delete_object(Bucket='meu-bucket', Key='fotos/photo.jpg') # delete
url = s3.generate_presigned_url( # presigned URL (GET, 1h)
'get_object',
Params={'Bucket': 'meu-bucket', 'Key': 'fotos/photo.jpg'},
ExpiresIn=3600,
)
π Authentication
SigV4
AWS standard. Every key generated in the panel signs correctly when used with SDKs.
Presigned URLs
Issue temporary URLs for upload or download without exposing your key. Validity from 1 second to 7 days.
Anonymous (public)
Buckets with a public policy allow GET and HEAD with no credentials. Handy for static distribution.
Where to get your credentials: In the customer panel, open Keys, create a new key, copy the Access Key and Secret Key. Each key can be bound to specific buckets.
π¦ Supported operations
Exhaustive table of available operations. Blocks are intentional, for security or business-model reasons.
ποΈ Bucket operations
| Operation | HTTP | Status | Notes |
|---|---|---|---|
| ListBuckets | GET / | β | Lists only buckets owned by your account, using public names. |
| HeadBucket | HEAD /{bucket} | β | β |
| ListObjects / V2 | GET /{bucket} | β | Accepts prefix, delimiter, max-keys, continuation-token (V2), and start-after. |
| GetBucketPolicy | GET /{bucket}?policy | β | The returned policy references buckets by their public names within your account. |
| PutBucketPolicy | PUT /{bucket}?policy | β οΈ | The policy must reference only buckets within your account. |
| DeleteBucketPolicy | DELETE /{bucket}?policy | β | β |
| Versioning | /{bucket}?versioning | β | Versioning and bucket/object tagging are supported via the S3 API. |
| Bucket / Object Tagging | /{bucket}[/{key}]?tagging | β | β |
| Lifecycle | /{bucket}?lifecycle | β | Expiration and transition rules are supported; expiration permanently deletes objects that match the rule. |
π Object operations
| Operation | HTTP | Status | Notes |
|---|---|---|---|
| GetObject | GET /{bucket}/{key} | β | Accepts Range, If-Match, If-None-Match, and other standard headers. |
| HeadObject | HEAD /{bucket}/{key} | β | β |
| PutObject | PUT /{bucket}/{key} | β | Supports aws-chunked and STREAMING-AWS4-HMAC-SHA256-PAYLOAD bodies for large uploads. |
| DeleteObject | DELETE /{bucket}/{key} | β | β |
| CopyObject | PUT + x-amz-copy-source | β | Use the public name of the source bucket in x-amz-copy-source. Copies between buckets within your account are supported. |
| GetObjectTagging / PutObjectTagging | /{bucket}/{key}?tagging | β | β |
π§© Multipart upload
| Operation | HTTP | Status |
|---|---|---|
| CreateMultipartUpload | POST /{bucket}/{key}?uploads | β |
| UploadPart | PUT /{bucket}/{key}?partNumber=N&uploadId=... | β |
| ListParts | GET /{bucket}/{key}?uploadId=... | β |
| CompleteMultipartUpload | POST /{bucket}/{key}?uploadId=... | β |
| AbortMultipartUpload | DELETE /{bucket}/{key}?uploadId=... | β |
| ListMultipartUploads | GET /{bucket}?uploads | β |
π Presigned URLs
Generate temporary upload (PUT) or download (GET) links without exposing your keys. The signature and expiry are validated on every request before access is authorized.
- β±οΈAccepted validity: 1 second up to 7 days (604800 seconds).
- πClock skew tolerance: Β±15 minutes. Keep your server NTP-synced.
- πWorks for GET, PUT, DELETE, and any other operation your SDK can presign.
π Public (anonymous) buckets
Apply a BucketPolicy granting GetObject to Principal "*" and the content becomes available via direct URL. Useful for CDN, static sites, or shared assets.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": "*",
"Action": ["s3:GetObject"],
"Resource": ["arn:aws:s3:::meu-bucket/*"]
}]
}
Direct URL for public objects:
https://s3.petadata.com.br:2222/meu-bucket/imagem.jpg
π¨ Common error codes
| Code | HTTP | Meaning |
|---|---|---|
| SignatureDoesNotMatch | 403 | Request signature does not match. Check your Secret Key, the region (us-east-1), and your server clock. |
| InvalidAccessKeyId | 403 | The Access Key does not exist or has been disabled. Check it in the panel. |
| AccessDenied | 403 | The key used has no permission for this operation or this bucket. |
| NoSuchBucket | 404 | Bucket not found for your account. Check the name in the panel. |
| NoSuchKey | 404 | Object not found within the given bucket. |
| KeyTooLongError | 400 | A segment of the object key exceeded 255 bytes. |
| RequestTimeTooSkewed | 403 | Clock difference between your client and our server exceeds 15 minutes. |
| AccountSuspended | 403 | Your account is suspended (balance or manual block). Add credits or contact support to reactivate. |
| QuotaExceeded | 403 | Storage quota exceeded. The account goes read-only: listing, downloading, and deleting stay available so you can free space, but new uploads are blocked until you are back under the limit or reserve more space. |
| AuthorizationQueryParametersError | 400 | Invalid presigned URL parameters: X-Amz-Expires outside 1..604800 seconds, or a malformed X-Amz-Date. |
| MigrationInProgress | 503 | Your account is being migrated between instances. Write operations (PUT/POST/DELETE) are temporarily unavailable; reads keep working. |
| ServiceUnavailable | 503 | The storage service is temporarily unavailable (instance or server down). Retry shortly. |
| NotImplemented | 501 | The requested feature (e.g., per-bucket CORS or website configuration) is not supported by the storage backend. |
β οΈ Limitations and gotchas
Unsupported S3 operations
| Operation | Notes |
|---|---|
| CreateBucket | Bucket creation happens in the customer panel, not via SDK. |
| DeleteBucket | Bucket deletion happens in the customer panel, not via SDK. |
| Get/PutBucketAcl, Get/PutObjectAcl | Bucket and object ACLs are not supported (returns AccessDenied). Use BucketPolicy to control access. |
| GetBucketLogging | Server-access logging via the S3 API is not supported (returns AccessDenied); use bucket notifications. |
| CORS | Cross-origin requests are allowed globally; per-bucket CORS configuration is not supported (returns 501). |
| Website | Static website hosting configuration is not supported by the storage backend (returns 501). |
Path-style only
URLs in the form https://s3.petadata.com.br:2222/bucket/key. Virtual-host-style (bucket.s3.petadata.com.br) is not supported. Set forcePathStyle = true in the SDK.
Max key segment length
Each slash-separated segment of the object key supports up to 255 bytes. Larger keys return 400 KeyTooLongError.
Fixed region us-east-1
The service assumes us-east-1 for every SigV4 signature. Use exactly that region in the SDK; declaring another region causes SignatureDoesNotMatch.
HTTPS required
The endpoint only accepts TLS connections on port 2222. Plain HTTP is rejected.
π¬ Need help?
Our team replies in Portuguese, English, and Spanish. For urgent issues prefer WhatsApp.