mirror of
https://github.com/beshu-tech/deltaglider.git
synced 2026-03-29 21:31:49 +02:00
docs: Update SDK documentation for accuracy and new features
Updated SDK documentation to reflect accurate boto3 compatibility and document new bucket management features. **API Reference (docs/sdk/api.md)**: - Changed '100% compatibility' to accurate '21 essential methods covering 80% of use cases' - Added complete documentation for create_bucket, delete_bucket, list_buckets methods - Added link to BOTO3_COMPATIBILITY.md for complete coverage details **Examples (docs/sdk/examples.md)**: - Added new 'Bucket Management' section with complete lifecycle examples - Demonstrated idempotent operations for safe automation - Added hybrid boto3/DeltaGlider usage pattern for advanced features - Showed how to use both libraries together effectively All documentation now accurately represents DeltaGlider's capabilities and provides clear guidance on when to use boto3 for advanced features. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -5,14 +5,15 @@ Real-world examples and patterns for using DeltaGlider in production application
|
||||
## Table of Contents
|
||||
|
||||
1. [Performance-Optimized Bucket Listing](#performance-optimized-bucket-listing)
|
||||
2. [Software Release Management](#software-release-management)
|
||||
3. [Database Backup System](#database-backup-system)
|
||||
4. [CI/CD Pipeline Integration](#cicd-pipeline-integration)
|
||||
5. [Container Registry Storage](#container-registry-storage)
|
||||
6. [Machine Learning Model Versioning](#machine-learning-model-versioning)
|
||||
7. [Game Asset Distribution](#game-asset-distribution)
|
||||
8. [Log Archive Management](#log-archive-management)
|
||||
9. [Multi-Region Replication](#multi-region-replication)
|
||||
2. [Bucket Management](#bucket-management)
|
||||
3. [Software Release Management](#software-release-management)
|
||||
4. [Database Backup System](#database-backup-system)
|
||||
5. [CI/CD Pipeline Integration](#cicd-pipeline-integration)
|
||||
6. [Container Registry Storage](#container-registry-storage)
|
||||
7. [Machine Learning Model Versioning](#machine-learning-model-versioning)
|
||||
8. [Game Asset Distribution](#game-asset-distribution)
|
||||
9. [Log Archive Management](#log-archive-management)
|
||||
10. [Multi-Region Replication](#multi-region-replication)
|
||||
|
||||
## Performance-Optimized Bucket Listing
|
||||
|
||||
@@ -204,6 +205,94 @@ performance_comparison('releases')
|
||||
|
||||
5. **Batch Analytics**: When doing analytics, fetch metadata once and process the results rather than making multiple calls.
|
||||
|
||||
## Bucket Management
|
||||
|
||||
DeltaGlider provides boto3-compatible bucket management methods for creating, listing, and deleting buckets without requiring boto3.
|
||||
|
||||
### Complete Bucket Lifecycle
|
||||
|
||||
```python
|
||||
from deltaglider import create_client
|
||||
|
||||
client = create_client()
|
||||
|
||||
# Create bucket
|
||||
client.create_bucket(Bucket='my-releases')
|
||||
|
||||
# Create bucket in specific region
|
||||
client.create_bucket(
|
||||
Bucket='eu-backups',
|
||||
CreateBucketConfiguration={'LocationConstraint': 'eu-west-1'}
|
||||
)
|
||||
|
||||
# List all buckets
|
||||
response = client.list_buckets()
|
||||
for bucket in response['Buckets']:
|
||||
print(f"{bucket['Name']} - Created: {bucket['CreationDate']}")
|
||||
|
||||
# Upload some objects
|
||||
with open('app-v1.0.0.zip', 'rb') as f:
|
||||
client.put_object(Bucket='my-releases', Key='v1.0.0/app.zip', Body=f)
|
||||
|
||||
# Delete objects first (bucket must be empty)
|
||||
client.delete_object(Bucket='my-releases', Key='v1.0.0/app.zip')
|
||||
|
||||
# Delete bucket
|
||||
client.delete_bucket(Bucket='my-releases')
|
||||
```
|
||||
|
||||
### Idempotent Operations
|
||||
|
||||
Bucket management operations are idempotent for safe automation:
|
||||
|
||||
```python
|
||||
# Creating existing bucket returns success (no error)
|
||||
client.create_bucket(Bucket='my-releases')
|
||||
client.create_bucket(Bucket='my-releases') # Safe, returns success
|
||||
|
||||
# Deleting non-existent bucket returns success (no error)
|
||||
client.delete_bucket(Bucket='non-existent') # Safe, returns success
|
||||
```
|
||||
|
||||
### Hybrid boto3/DeltaGlider Usage
|
||||
|
||||
For advanced S3 features not in DeltaGlider's 21 core methods, use boto3 directly:
|
||||
|
||||
```python
|
||||
from deltaglider import create_client
|
||||
import boto3
|
||||
|
||||
# DeltaGlider for core operations with compression
|
||||
dg_client = create_client()
|
||||
|
||||
# boto3 for advanced features
|
||||
s3_client = boto3.client('s3')
|
||||
|
||||
# Use DeltaGlider for object operations (with compression)
|
||||
with open('release.zip', 'rb') as f:
|
||||
dg_client.put_object(Bucket='releases', Key='v1.0.0/release.zip', Body=f)
|
||||
|
||||
# Use boto3 for advanced bucket features
|
||||
s3_client.put_bucket_versioning(
|
||||
Bucket='releases',
|
||||
VersioningConfiguration={'Status': 'Enabled'}
|
||||
)
|
||||
|
||||
# Use boto3 for bucket policies
|
||||
policy = {
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [{
|
||||
"Effect": "Allow",
|
||||
"Principal": "*",
|
||||
"Action": "s3:GetObject",
|
||||
"Resource": "arn:aws:s3:::releases/*"
|
||||
}]
|
||||
}
|
||||
s3_client.put_bucket_policy(Bucket='releases', Policy=json.dumps(policy))
|
||||
```
|
||||
|
||||
See [BOTO3_COMPATIBILITY.md](../../BOTO3_COMPATIBILITY.md) for complete method coverage.
|
||||
|
||||
## Software Release Management
|
||||
|
||||
### Managing Multiple Product Lines
|
||||
|
||||
Reference in New Issue
Block a user