Beta Releases
Beta Release: New Global Storage API
The Global Storage API is a new service that provides a single, unified endpoint for managing your data across the globe.
Features in Beta: - **Global Replication:** Data is automatically replicated across selected regions for high availability. - **Edge Caching:** Caching at the edge for faster access to frequently used objects. - **Custom Domains:** Use your own domain name for your storage buckets.
Example: Uploading a file
python
import os
from storage_client import StorageClient
storage = StorageClient(api_key=os.environ.get("STORAGE_API_KEY"))
def upload_file(bucket_name, file_path):
try:
with open(file_path, "rb") as f:
response = storage.files.upload(
bucket=bucket_name,
file=f,
key="my-remote-file.txt"
)
print(f"File uploaded successfully: {response.url}")
except Exception as e:
print(f"Error uploading file: {e}")
upload_file("my-global-bucket", "./local-file.txt")
This is a beta release, and the API is subject to change. We welcome your feedback to help us improve the service. Please report any issues or suggestions in our community forum.