惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
B
Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
V
Vulnerabilities – Threatpost
Vercel News
Vercel News
Stack Overflow Blog
Stack Overflow Blog
大猫的无限游戏
大猫的无限游戏
L
Lohrmann on Cybersecurity
T
Tailwind CSS Blog
Martin Fowler
Martin Fowler
S
Schneier on Security
博客园 - 三生石上(FineUI控件)
V
V2EX
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
Security Latest
Security Latest
J
Java Code Geeks
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Threat Research - Cisco Blogs
月光博客
月光博客
有赞技术团队
有赞技术团队
Recent Announcements
Recent Announcements
aimingoo的专栏
aimingoo的专栏
V
Visual Studio Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
H
Help Net Security
W
WeLiveSecurity
宝玉的分享
宝玉的分享
Cyberwarzone
Cyberwarzone
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
Webroot Blog
Webroot Blog
A
Arctic Wolf
I
InfoQ
博客园 - 聂微东
Application and Cybersecurity Blog
Application and Cybersecurity Blog
P
Privacy International News Feed
NISL@THU
NISL@THU
L
LINUX DO - 热门话题
L
LINUX DO - 最新话题
C
Cisco Blogs
博客园 - 叶小钗
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Register - Security
The Register - Security
B
Blog RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
GbyAI
GbyAI

OneUptime Blog

How to Monitor Azure App Services (PaaS) with OpenTelemetry Grafana Stack vs OneUptime: DIY Observability or Unified Platform? Your AI Workloads Are About to Blow Up Your Observability Bill The Great Observability Consolidation Is Here How to Write Custom Object Classes for Ceph How to Write Custom Ceph Manager Modules How to Write a ceph.conf Configuration File How to Use Rook-Ceph with OpenShift How to Use Rook-Ceph with Longhorn for Comparison How to Configure Volume Snapshot Class for RBD in Rook How to Configure VolumeReplicationClass Scheduling Intervals in Rook How to Set Up Volume Replication with Rook-Ceph How to Create Volume Group Snapshots with Rook CSI How to Visualize Ceph Network Performance in Grafana How to Enable Virtual Host-Style Bucket Access in Rook How to View Runtime Configuration via Admin Socket How to View Quota Settings and Update Stats in Ceph RGW How to View PG Scaling Recommendations with autoscale-status How to View PG Distribution via Admin Socket How to View Performance Metrics in the Ceph Dashboard How to View OSD Performance Counters in Ceph How to View Connection Status via Admin Socket How to View Ceph Cluster Summary Dashboard via CLI How to Version Control Rook-Ceph Configuration How to Version Control Ceph Infrastructure with Terraform How to Verify Kubernetes Node Requirements for Rook-Ceph Deployment How to Verify Health Before and After Rook Upgrades How to Verify Data Integrity with Deep Scrubbing How to Verify Complete Rook-Ceph Cleanup How to Verify Backup Integrity from Ceph Snapshots How to Use Rook-Ceph with Velero for Kubernetes Backup How to Integrate HashiCorp Vault with Rook-Ceph (Token Auth) How to Configure TLS for Vault Integration in Rook How to Integrate HashiCorp Vault with Rook-Ceph (Kubernetes Auth) How to Validate Ceph Cluster Configuration After Deployment How to Understand User Type and ID Notation (TYPE.ID) in Ceph How to Configure User Management in the Ceph Dashboard How to Use Rook-Ceph with Kubernetes Operators How to Use Rook-Ceph with Helm Chart Deployments How to Use the Swift API with Ceph RGW How to Use SQLite Databases Stored on Ceph How to Use s3cmd with Ceph RGW How to Use the S3 API with Ceph RGW How to Use Red Hat Ceph with RHEL Virtualization How to Use RBD with QEMU How to Use RBD with Nomad How to Use RBD with CloudStack How to Use RBD Snapshot Rollback How to Use rados bench for Object Storage Benchmarking How to Secure Rook-Ceph with Pod Security Admission How to Use pg-upmap for PG Mapping in Ceph How to Use Multipath Devices with Ceph OSDs How to Use MinIO Client (mc) with Ceph RGW How to Use fs swap for CephFS How to Use fio for Ceph Block Storage Benchmarking How to Use the CephFS Shell How to Use Ceph RGW for Media Asset Management How to Use Ceph RGW for Log Storage and Archival How to Use Ceph RGW for Data Lake Storage How to Use Ceph RGW for Backup Repository Storage How to Use the ceph-authtool Utility How to Use AWS CLI with Ceph RGW S3 How to Use the Admin Ops API with Ceph RGW How to Configure Usage Log Key Transition in Ceph RGW How to Handle Rook-Ceph Upgrades in GitOps Pipelines How to Upgrade Rook-Ceph with Zero Downtime How to Create a Ceph Upgrade Runbook How to Upgrade the Rook Operator from v1.18 to v1.19 How to Upgrade the Rook Operator on Kubernetes How to Upgrade External Cluster Connections in Rook How to Upgrade the Ceph Version in Rook How to Upgrade from Ceph Reef to Squid How to Upgrade from Ceph Quincy to Reef How to Upgrade Ceph Clusters in Stretch Mode How to Update Kernel for CephFS Feature Compatibility How to Update Ceph Configuration on a Running Rook Cluster How to Create Unique Kubernetes Services per NFS Server in Rook How to Understand When Compression Helps vs Hurts in Ceph How to Understand User Types (Individual vs System) in Ceph How to Understand the undersized PG State in Ceph How to Understand the stale PG State in Ceph How to Understand the repair PG State in Ceph How to Understand the remapped PG State in Ceph How to Understand Red Hat Ceph Storage vs Upstream Ceph How to Understand Placement Groups in Ceph How to Understand PG Splitting in Ceph How to Understand the peering PG State in Ceph How to Understand OSD Recovery Process in Ceph How to Understand the OSD Map in Ceph How to Understand New Features in Each Ceph Release How to Understand Monitor Leadership in Ceph How to Understand MDS States in CephFS How to Understand Deprecated Features in Ceph Reef How to Understand the degraded PG State in Ceph How to Understand D3N in Ceph How to Understand the creating PG State in Ceph How to Understand the clean PG State in Ceph How to Understand CephX Authentication Protocol How to Understand CephX Authentication Flow How to Understand What Data Ceph Telemetry Collects
How to Use boto3 (Python) with Ceph RGW S3
Nawaz Dhandala · 2026-03-31 · via OneUptime Blog

Overview

boto3 is the official AWS SDK for Python. By passing a custom endpoint_url and disabling SSL for development, you can use it to interact with Ceph RGW exactly as you would with AWS S3. This makes it easy to write Python applications that work against your on-premises Ceph cluster.

Install boto3

pip install boto3

Create a boto3 Session for Ceph

import boto3
from botocore.client import Config

s3 = boto3.client(
    "s3",
    endpoint_url="http://rook-ceph-rgw-my-store.rook-ceph:80",
    aws_access_key_id="myaccesskey",
    aws_secret_access_key="mysecretkey",
    region_name="us-east-1",
    config=Config(signature_version="s3v4", s3={"addressing_style": "path"}),
)

Bucket Operations

Create a bucket:

s3.create_bucket(Bucket="my-python-bucket")

List all buckets:

response = s3.list_buckets()
for bucket in response["Buckets"]:
    print(bucket["Name"])

Delete a bucket (must be empty):

s3.delete_bucket(Bucket="my-python-bucket")

Object Operations

Upload a file:

s3.upload_file(
    Filename="/tmp/data.json",
    Bucket="my-python-bucket",
    Key="data/data.json",
)

Upload from memory:

import json

data = {"key": "value", "count": 42}
s3.put_object(
    Bucket="my-python-bucket",
    Key="config/settings.json",
    Body=json.dumps(data),
    ContentType="application/json",
)

Download a file:

s3.download_file(
    Bucket="my-python-bucket",
    Key="data/data.json",
    Filename="/tmp/downloaded.json",
)

List objects in a bucket:

paginator = s3.get_paginator("list_objects_v2")
for page in paginator.paginate(Bucket="my-python-bucket", Prefix="data/"):
    for obj in page.get("Contents", []):
        print(obj["Key"], obj["Size"])

Generate a Presigned URL

url = s3.generate_presigned_url(
    ClientMethod="get_object",
    Params={"Bucket": "my-python-bucket", "Key": "data/data.json"},
    ExpiresIn=3600,
)
print(url)

Copy Objects

s3.copy_object(
    CopySource={"Bucket": "my-python-bucket", "Key": "data/data.json"},
    Bucket="my-python-bucket",
    Key="backup/data.json",
)

Error Handling

from botocore.exceptions import ClientError

try:
    s3.head_object(Bucket="my-python-bucket", Key="nonexistent.txt")
except ClientError as e:
    if e.response["Error"]["Code"] == "404":
        print("Object does not exist")
    else:
        raise

Summary

boto3 works transparently with Ceph RGW by specifying a custom endpoint_url and path-style addressing. All standard S3 operations are supported, making it easy to build Python applications that run against both AWS S3 and on-premises Ceph with minimal configuration changes.