Skip to main content

fabric_ceph_client

Python client for the FABRIC Ceph Manager service, which brokers access to FABRIC's distributed Ceph clusters: CephFS subvolumes and CephX users for POSIX storage, and RGW users, keys and buckets for S3.

Its only dependency is requests.

Install

pip install fabric_ceph_client

Usage

Authenticate with a FABRIC token, either inline or from a token file:

from fabric_ceph_client.fabric_ceph_client import CephManagerClient

client = CephManagerClient(
    base_url="https://ceph-mgr.fabric-testbed.net",
    token_file="~/work/fabric_config/id_token.json",
)

Every call targets a single cluster, passed as cluster. Each cluster is an independent Ceph deployment, so the same identity in two clusters is two separate accounts.

Cluster info

info = client.list_cluster_info()
for c in info["data"]:
    print(c["cluster"], c["mon_host"], c.get("s3_endpoints"))

CephFS

client.create_or_resize_subvolume(
    "east", "CEPH-FS-01", "alice", size=10 * 1024**3
)
client.get_subvolume_info("east", "CEPH-FS-01", "alice")
client.list_subvolumes("east", "CEPH-FS-01")
client.delete_subvolume("east", "CEPH-FS-01", "alice")

S3 (RGW)

An S3 user id is the user's FABRIC bastion login, the same identity used to name their CephFS subvolume.

# Users and access keys
client.list_s3_users("east")
client.get_s3_user("east", "alice_0000123456")

# Secrets are withheld from listings unless asked for explicitly
client.list_s3_user_keys("east", "alice_0000123456", include_secret=True)

# Creating a key also provisions the S3 user on first use
key = client.create_s3_user_key("east", "alice_0000123456")
print(key["access_key"], key["secret_key"])

# Buckets
client.list_s3_buckets("east", uid="alice_0000123456")
client.get_s3_bucket("east", "my-bucket")
client.set_s3_bucket_quota("east", "my-bucket", enabled=True, max_size_kb=1024**2)

Creating and deleting buckets is restricted to FABRIC facility administrators and owners of the FABRIC Ceph service project. Regular users can read and write objects in the buckets they own, using the credentials above with any S3 client (aws-cli, s3cmd, boto3, rclone). Object data goes directly to the Ceph RGW gateway and never passes through the Ceph Manager service.

Errors

Failed requests raise ApiError, which carries the HTTP status, the URL, and the parsed response body:

from fabric_ceph_client.fabric_ceph_client import ApiError

try:
    client.get_s3_bucket("east", "nope")
except ApiError as e:
    print(e.status, e.message, e.payload)

Links

License

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fabric_ceph_client-1.1.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fabric_ceph_client-1.1.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file fabric_ceph_client-1.1.0.tar.gz.

File metadata

  • Download URL: fabric_ceph_client-1.1.0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for fabric_ceph_client-1.1.0.tar.gz
Algorithm Hash digest
SHA256 e41a0c020f300193e08ed8fdb7e79ebc97eb112331b56aae6098ff40b3ab606c
MD5 43afbe65b6772ac6908e0ed5ff7030e6
BLAKE2b-256 0592d52e6f01b7c567c9794a3c8c449ef1d9ca1f52d1ccda25425b0e006ce1d6

See more details on using hashes here.

File details

Details for the file fabric_ceph_client-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fabric_ceph_client-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d391b8823507bffab0fb30daae452c22f49e2ad2fffc0a604f89fc71bf727e5
MD5 73a9fcc80e14200c9777fd05df160b41
BLAKE2b-256 c2cbc3ffec4e7851e5f42229efe03410d226c97fed0d25f5d924403a6a34fcb8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page