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.1.tar.gz (13.8 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.1-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fabric_ceph_client-1.1.1.tar.gz
  • Upload date:
  • Size: 13.8 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.1.tar.gz
Algorithm Hash digest
SHA256 aca722bcc25195378ff7376d5fb2a4d178123832f6bee85ceb23806beea19b98
MD5 e849381fc7abb05e4b0d923979279e2a
BLAKE2b-256 12f9036c77742553f9164850dcb1d5bd56c5ed52d684f3feb488d22c7c1e5404

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fabric_ceph_client-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ba00440dd861610660624a9b1f4dbb476d5078b168ed6762f7b11d6b27ece3f0
MD5 0f5ac3d25592e48f69c5bc599871a2a5
BLAKE2b-256 07fa4e10b8e7b2bc893e739dcb76c8c7badaf0a4714d18cd6036bbc69d2997dd

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